summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* opusdec: make sure all substreams have the same number of coded samplesAnton Khirnov2014-11-27
| | | | | | Fixes invalid writes with invalid multichannel streams. CC:libav-stable@libav.org
* vf_interlace: get rid of useless loadsKieran Kunhya2014-11-27
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavu: fix memory leaks by using a mutex instead of atomicswm42014-11-27
| | | | | | | | | | | | | | | | | | | | | The buffer pool has to atomically add and remove entries from the linked list of available buffers. This was done by removing the entire list with a CAS operation, working on it, and then setting it back again (using a retry-loop in case another thread was doing the same thing). This could effectively cause memory leaks: while a thread was working on the buffer list, other threads would allocate new buffers, increasing the pool's total size. There was no real leak, but since these extra buffers were not needed, but not free'd either (except when the buffer pool was destroyed), this had the same effects as a real leak. For some reason, growth was exponential, and could easily kill the process due to OOM in real-world uses. Fix this by using a mutex to protect the list operations. The fancy way atomics remove the whole list to work on it is not needed anymore, which also avoids the situation which was causing the leak. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavu: add wrappers for the pthreads mutex APIAnton Khirnov2014-11-27
| | | | | | | | | | Also add no-op fallbacks when threading is disabled. This helps keeping the code clean if Libav is compiled for targets without threading. Since we assume that no threads of any kind are used in such configurations, doing nothing is ok by definition. Based on a patch by wm4 <nfxjfg@googlemail.com>.
* Revert "lavf: Don't try to update files atomically with renames on windows"Martin Storsjö2014-11-27
| | | | | | | | | This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c. After taking MoveFileEx into use, we can replace files with renames on windows as well. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Use MoveFileEx instead of rename/_wrename on windowsMartin Storsjö2014-11-27
| | | | | | | | | This allows getting the normal unix semantics, where a rename allows replacing an existing file. Based on a suggestion by Reimar Döffinger. Signed-off-by: Martin Storsjö <martin@martin.st>
* Share the utf8 to wchar conversion routine between lavf and lavuMartin Storsjö2014-11-27
| | | | | | | | This doesn't add any dependency on library internals, since this only is a static inline function that gets built into each of the calling functions - this is only to reduce the code duplication. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Expose the fragment index as an avoptionMartin Storsjö2014-11-26
| | | | | | | | This allows setting the right fragment number if doing random-access writing of fragments, and also allows reading the current sequence number. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Add a flag for indicating a discontinuous fragmentMartin Storsjö2014-11-26
| | | | | | | | | | | | | | | | | | | | | | | This allows creating a later mp4 fragment without sequentially writing the earlier ones before (when called from a segmenter). Normally when writing a fragmented mp4 file sequentially, the first timestamps of a fragment are adjusted to match the end of the previous fragment, to make sure the timestamp is the same, even if it is calculated as the sum of previous fragment durations. (And for the first packet in a file, the offset of the first packet is written using an edit list.) When writing an individual mp4 fragment discontinuously like this (with potentially writing the earlier fragments separately later), there's a risk of getting a gap in the timeline if the duration field of the last packet in the previous fragment doesn't match up with the start time of the next fragment. Using this requires setting -avoid_negative_ts make_non_negative (or -avoid_negative_ts 0). Signed-off-by: Martin Storsjö <martin@martin.st>
* vorbis_parser: Include stdint.h in the header, to make it work standaloneMartin Storsjö2014-11-25
| | | | | | This fixes "make checkheaders". Signed-off-by: Martin Storsjö <martin@martin.st>
* vf_interlace: x86: improve asm performanceMichael Niedermayer2014-11-25
| | | | 4775 decicycles -> 3688 decicycles
* hnm4: change width/height to int to fix hypothetical integer overflowsMichael Niedermayer2014-11-25
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1135770 / CID 1135771
* hnm4: Use av_image_check_sizeLuca Barbato2014-11-25
| | | | | | | As done for all the other codecs not calling it indirectly. CC: libav-stable@libav.org Bug-Id: CID 1135770 / CID 1135771
* vc1: Use the correct shift amountMichael Niedermayer2014-11-25
| | | | | | | | | `is_intra` is a 6bits bitfield. CC: libav-stable@libav.org Bug-Id: CID 1194380 / CID 1194381 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* vc1: Set the is_intra bitfield to all 1 when neededLuca Barbato2014-11-25
| | | | | | | Keep the code as similar as possible across the codepaths to ease spotting it for factorization. Based on a patch from Michael Niedermayer <michaelni@gmx.at>.
* vc1: Simplify a little setting the intra variablesLuca Barbato2014-11-25
| | | | | | | | The code currently set the information in at least 4 places, spare some pointless loops. Make the code in the loop a little uniform to make easier factorize it out later.
* vorbis_parser: Move vp check to avoid a null pointer dereferenceMichael Niedermayer2014-11-25
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1251347
* lpc: remove unneeded {}Michael Niedermayer2014-11-25
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* vc1pred: remove logically dead codeVittorio Giovara2014-11-25
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1245699 / CID 1245700
* lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlinkMartin Storsjö2014-11-24
| | | | | | | | | | | | | | | | | | This makes sure that the internal utf8 path names are handled properly - the normal file handling functions assume path names are in the native codepage, which isn't utf8. This assumes that the tools outside of lavf don't use the mkdir definition. (The tools don't do the same reading of command line parameters as wchar either - they probably won't handle all possible unicode file parameters properly, but at least work more predictably if no utf8/wchar conversion is involved.) This is moved further down in os_support.h, since windows.h shouldn't be included before winsock2.h, while io.h needs to be included before the manual defines for lseek functions. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Don't try to update files atomically with renames on windowsMartin Storsjö2014-11-24
| | | | | | | | | On windows, rename(2) will fail if the target file exists. On unix this trick is used to make sure that people reading the file either will get the full previous file, or the full new version of the file, but no intermediate version. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Document how the duration is retrieved at the end of the fileUwe L. Korn2014-11-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Don't segment all video streams when one stream gets a keyframeMartin Storsjö2014-11-24
| | | | | | | | | This makes sure that segments actually start at a keyframe (and makes sure we don't split segments twice in a row, with one segment consisting of only a handful of packets), when one stream uses b-frames while another one doesn't. Signed-off-by: Martin Storsjö <martin@martin.st>
* sidxindex: Write mimeType=audio/mp4 for audio-only representationsMartin Storsjö2014-11-24
| | | | | | | This fixes playback with dash.js, when the input is one separate mp4 file per track. Signed-off-by: Martin Storsjö <martin@martin.st>
* aacsbr: always initialize max_qmf_subbandsVittorio Giovara2014-11-24
| | | | Fixes a wordly warning from clang -Wsometimes-uninitialized.
* roqaudio: Always use the frame buffer on flushMichael Niedermayer2014-11-24
| | | | | | | | Prevent NULL dereference. CC: libav-stable@libav.org Bug-Id: CID 703669 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* tiffenc: initialize return valueVittorio Giovara2014-11-24
| | | | | | | | | 'ret' can only be used without initialization if s->height <= 0, which can only happen if avctx->height <= 0, which is validated elsewhere. Doesn't hurt to still initialize it though. CC: libav-stable@libav.org Bug-Id: CID 732296
* cook: Make sure there is enough extradataLuca Barbato2014-11-24
| | | | | | | At least 8 bytes are needed (Mono audio). Bug-Id: CID 741418 CC: libav-stable@libav.org
* sol: simplify sol_codec_id()Vittorio Giovara2014-11-24
| | | | Bug-Id: CID 1238993
* aacdec: avoid an out-of-bounds writeVittorio Giovara2014-11-24
| | | | | | | Also move the check in the case it is actually used. CC: libav-stable@libav.org Bug-Id: CID 1087090
* lavu: move internal define to the only places where it is usedVittorio Giovara2014-11-24
|
* mpegenc: prevent a NULL pointer dereferenceVittorio Giovara2014-11-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 29261
* motion_est: convert stride to ptrdiff_tVittorio Giovara2014-11-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 700556 / CID 700557 / CID 700558
* dashenc: Don't require the stream bitrate to be knownMartin Storsjö2014-11-22
| | | | | | | | | | | | | Don't write any bitrate attribute if it isn't known. As long as one doesn't want automatic bitrate switching, playback can work just fine even if it isn't set. If strict standard compliance is requested, this is still considered an error, since the attribute is mandatory according to the spec. Based on a patch by Rodger Combs. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Remove a redundant include of sys/stat.hMartin Storsjö2014-11-22
| | | | | | | The same file already includes this header a few lines further above. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvenc: Remove an unused variableMichael Niedermayer2014-11-22
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* hevc: Spin the mv_mpv_mode calls in a stand alone functionLuca Barbato2014-11-21
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* qdm2: avoid integer overflowVittorio Giovara2014-11-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 700555
* vp9: Use the correct upper bound for seg_idLuca Barbato2014-11-21
| | | | | | And use a macro to make apparent why the value. Bug-Id: CID 1108595
* dvdsubdec: Do not leak on failure pathLuca Barbato2014-11-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1198262
* libtwolame: prevent a NULL pointer dereferenceVittorio Giovara2014-11-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1250330 / CID 1250335
* lavfi: clean memory on error in ADD_FORMAT()Vittorio Giovara2014-11-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1250334
* xwma: Do not leak on failure pathLuca Barbato2014-11-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1087092
* lavc: Move the libtwolame encoder registration to the list for external ↵Martin Storsjö2014-11-21
| | | | | | | | | | | | | libraries This makes sure the default behaviour of using the internal encoder stays the same regardless if libtwolame is enabled or not (as for any external library). This fixes fate-lavf-mpg if libav is built with libtwolame enabled. CC: libav-stable@libav.org Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* hdsenc: Clear the previous codec tag when setting up the chained muxerMartin Storsjö2014-11-19
| | | | | | | | | | | | | | The chained flv muxer wants one set of tags - normally this set could be signaled via the AVOutputFormat codec_tag field (as smoothstreamingenc and dashenc do). hdsenc doesn't signal it, since the FLV codec tag arrays aren't exported from flvenc.c. This can lead to the caller keeping an original codec tag from the originating container here, which would then be a mismatch for the FLV muxer. Since we don't really care about what codec tag the caller might have set, just clear it and let the lavf muxer layer set the right one for the chained FLV muxer later instead. Signed-off-by: Martin Storsjö <martin@martin.st>
* hdsenc: Use the right filename in an error messageMartin Storsjö2014-11-19
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* configure: Fix enabling memalign_hack automaticallyMartin Storsjö2014-11-18
| | | | | | | | | simd_align_16 is a configure item that can be enabled or disabled, it's not a variable containing a list of other configure items as need_memalign previously. This was broken in eba2233b5. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: check ff_get_wav_header() return valueVittorio Giovara2014-11-18
| | | | | CC: libav-stable@libav.org Bug-Id: CID 717497
* lavc: fix bitshifts amount bigger than the typeVittorio Giovara2014-11-18
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
* libvpxenc: clean memory on errorVittorio Giovara2014-11-18
| | | | | CC: libav-stable@libav.org Bug-Id: CID 733795