summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* h264_sei: parse the picture timing SEIs correctlyAnton Khirnov2020-04-10
| | | | | | | | | Those SEIs refer to the currently active SPS. However, since the SEI NALUs precede the coded picture data in the bitstream, the active SPS is in general not known when we are decoding the SEI. Therefore, store the content of the picture timing SEIs and actually parse it when the active SPS is known.
* h264_sei: use a separate reader for the individual SEI messagesAnton Khirnov2020-04-10
| | | | | This tells the parsing functions the payload size and prevents them from overreading.
* h264dec: do not abort if decoding extradata failsAnton Khirnov2020-04-10
| | | | | | Such errors are not necessarily fatal and decoding might still be possible, e.g. it happens for MVC streams where we do not handle the subset SPS thus failing to parse its corresponding PPS.
* lavc: do not implicitly share the frame pool between threadsAnton Khirnov2020-04-10
| | | | | | | | | | | | | Currently the frame pool used by the default get_buffer2() implementation is a single struct, allocated when opening the decoder. A pointer to it is simply copied to each frame thread and we assume that no thread attempts to modify it at an unexpected time. This is rather fragile and potentially dangerous. With this commit, the frame pool is made refcounted, with the reference being propagated across threads along with other context variables. The frame pool is now also immutable - when the stream parameters change we drop the old reference and create a new one.
* pthread_frame: do not copy a range of AVCodecContext fields at onceAnton Khirnov2020-04-10
| | | | | This is extremely fragile against reordering and hides what is actually being copied. Copy all the fields manually instead.
* pthread_frame: do not embed full AVFrame structs into per-thread contextsAnton Khirnov2020-04-10
| | | | | Use the AVFrame API to properly allocate and free frames for delayed release.
* pthread_frame: do not share priv_data between multiple codec contextsAnton Khirnov2020-04-10
| | | | | | | | Specifically, between the user-facing one and the first frame thread one. This is fragile and dangerous, allocate separate private data for each per-thread context.
* pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov2020-04-10
| | | | | | | | | | | | | | | | init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once).
* lavc: replace AVCodecInternal.allocate_progress with an internal capAnton Khirnov2020-04-10
| | | | This is a constant codec property, so a capability flag is more appropriate.
* mpeg4videodec: do not copy a range of fields at onceAnton Khirnov2020-04-10
| | | | | This is extremely fragile against reordering and hides what is actually being copied. Copy all the fields manually instead.
* avcodec.h: split AVCodecDescriptor API into its own headerAnton Khirnov2020-04-10
|
* avcodec.h: split codec IDs into their own headerAnton Khirnov2020-04-10
|
* avcodec.h: split AVPacket API into its own headerAnton Khirnov2020-04-10
|
* wavpack: fully support stream parameter changesAnton Khirnov2020-04-10
| | | | Fix invalid memory access on DSD streams with changing channel count.
* decode: make sure ff_get_buffer() cleans the frame on failureAnton Khirnov2020-04-10
| | | | Merge ff_get_buffer() and get_buffer_internal() to simplify the code.
* pthread_frame: make sure ff_thread_release_buffer always cleans the frameAnton Khirnov2020-04-10
|
* lavc/libopenh264enc: fix the if-else coding styleLinjie Fu2020-04-10
| | | | | Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/zerocodec: use init cleanup internal capPaul B Mahol2020-04-10
|
* avcodec/zerocodec: implement flushingPaul B Mahol2020-04-10
|
* avcodec: add MV30 decoderPaul B Mahol2020-04-10
|
* avformat/hlsenc: return media_url directly if failed to get seperatorLimin Wang2020-04-10
| | | | | Fix ticket: 8606 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/matroskaenc: Remove unnecessary headersAndreas Rheinhardt2020-04-10
| | | | | | | | | | | | subtitles.h has been included in order to use ff_subtitles_next_line() to help parsing srt subtitles which at that time had their timing as part of the payload and not as part of the AVPacket fields. When this changed (in 55180b32) it has been forgotten to remove this header. libavcodec/internal.h meanwhile has been added in bb47aa5850c and has never been used at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeg2000dec: Fix mixed declaration and codeAndreas Rheinhardt2020-04-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mpeg: Don't use unintialized valueAndreas Rheinhardt2020-04-09
| | | | | | | | vobsub_read_packet() didn't check whether an array of AVPackets was valid and therefore used uninitialized values. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/ebur128: prefer to use variable instead of type for sizeofLimin Wang2020-04-09
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000dec.c: Add support for PPT markerGautam Ramakrishnan2020-04-09
| | | | | | | This patch adds functional changes to support the PPT marker. This patch fixes bug ticket #4610. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/v4l2_context: Use av_freep()Andriy Gelman2020-04-08
| | | | | Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avfilter/vf_drawtext: only test available exceptionsRosen Penev2020-04-09
| | | | | | | | soft float systems do not define these macros under musl. Fixes: Ticket7102 Signed-off-by: Rosen Penev <rosenp@gmail.com>
* avformat/segment: always use interleaved writes for formats with custom ↵Marton Balint2020-04-08
| | | | | | interleaving Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/hlsenc: use av_asprintf()Limin Wang2020-04-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: Factor out deleting files from deleting segmentsAndreas Rheinhardt2020-04-08
| | | | | | Removes code duplication. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: add subtitle support in master playlist m3u8Limin Wang2020-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | Test with the following command for the webvtt subtitle: $ ./ffmpeg -y -i input_with_subtitle.mkv \ -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \ -b:a:0 256k \ -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \ -f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \ -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \ 10 -master_pl_publish_rate 10 -hls_flags \ delete_segments+discont_start+split_by_time ./tmp/video.m3u8 Check the master m3u8: $ cat tmp/master.m3u8 #EXTM3U #EXT-X-VERSION:3 #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitle",NAME="subtitle_0",DEFAULT=YES,URI="video_vtt.m3u8" #EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33",SUBTITLES="subtitle" video.m3u8 Check the result by convert to mkv: $ ./ffmpeg -strict experimental -i ./tmp/master.m3u8 -c:v copy -c:a mp2 -c:s srt ./test.mkv Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsplaylist: simplify code for checking whether the string is emptyLimin Wang2020-04-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: remove the first slash of the relative path line in the ↵Limin Wang2020-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master m3u8 file Please testing with the following command: ./ffmpeg -y -i input.mkv \ -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \ -b:a:0 256k \ -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0\ -f hls -var_stream_map "v:0,a:0" \ -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \ 10 -master_pl_publish_rate 10 -hls_flags \ delete_segments+discont_start+split_by_time ./tmp/video.m3u8 then cat ./tmp/master.m3u8 before: #EXTM3U #EXT-X-VERSION:3 #EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33" /video.m3u8 $ ./ffmpeg -i ./tmp/master.m3u8 -c:v copy -c:a mp2 ./test.mkv [hls @ 0x7f82f9000000] Skip ('#EXT-X-VERSION:3') [hls @ 0x7f82f9000000] Opening '/video.m3u8' for reading [hls @ 0x7f82f9000000] parse_playlist error No such file or directory [/video.m3u8] ./tmp/master.m3u8: No such file or directory after: #EXTM3U #EXT-X-VERSION:3 #EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33" video.m3u8 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: Use AVBPrint to avoid allocations of stringsAndreas Rheinhardt2020-04-08
| | | | | | when deleting old segments. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/hlsenc: Fix memleak when deleting old segmentsAndreas Rheinhardt2020-04-08
| | | | | | | | | | | if the directory name of the segments contains "%v". This memleak is caused by masking the pointer that will eventually be freed by a variable of the same name in a smaller scope. Therefore the pointer that gets freed is always NULL when it is freed and the allocated data leaks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: CosmeticsAndreas Rheinhardt2020-04-08
| | | | | | | | | | This is mainly about improving legibility of the code and getting rid of overlong lines by using variables for st->codecpar instead of accessing the codecparameters via st->codecpar->. Also, some code has been moved to better fitting places. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Remove unused structureAndreas Rheinhardt2020-04-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Only store what is needed laterAndreas Rheinhardt2020-04-08
| | | | | | | | This commit removes data that is only used during smacker_read_header() from the demuxer's context and replaces the data that is used by local variables. The other data is completely dropped. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Create audio streams immediatelyAndreas Rheinhardt2020-04-08
| | | | | | | | | | | | | | | | | | | The Smacker demuxer currently parses several fields that indicate how many audio streams a file contains. This data is parsed and stored into arrays in the demuxer's context and although the data is used only to initialize the audio streams, it is kept for the whole lifetime of the demuxer. This has been changed: The data is used directly to create the audio streams and no longer kept at all. This also simplifies error handling in case adding a new stream fails: Several arrays which until now have been allocated between parsing the data determining how many audio streams to create and actually creating them would need to be freed in this case. Now the streams are created first, so freeing is no longer an issue. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Read extradata directly into extradataAndreas Rheinhardt2020-04-08
| | | | | | | | | | | | | | | | | | | | | The Smacker demuxer reads four consecutive 32bit values from the file header into its demux context (as four uint32_t), converting it to native endianness in the process and then writing these four values later (after extradata has been allocated) to extradata as four 32bit values (converting to little endian in the process). This commit changes this: The stream and the extradata are allocated earlier, so that the data destined for extradata can be read directly into extradata. Furthermore, given that these values are not needed for demuxing itself they are now no longer kept as part of the demuxing context. Finally, a check regarding the number of frames has been moved up, too, in order to exit early before unnecessarily allocating the stream and the extradata. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/flacdsp_template: Fix invalid shifts in decorrelateMichael Niedermayer2020-04-07
| | | | | | | | Fixes: left shift of negative value -2 Fixes: 20303/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5096829297623040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tools/target_dec_fuzzer: Adjust threshold for screenpressoMichael Niedermayer2020-04-07
| | | | | | | | Fixes: Timeout (332 -> 21 sec) Fixes: 20280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCREENPRESSO_fuzzer-6238663432470528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/xvididct: Fix integer overflow in MULT()Michael Niedermayer2020-04-07
| | | | | | | | Fixes: signed integer overflow: 23170 * 95058 cannot be represented in type 'int' Fixes: 20295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5800212870463488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffwavesynth: Correct undefined overflow of PINK_UNITMichael Niedermayer2020-04-07
| | | | | | | | Fixes: signed integer overflow: 9223372036854775775 + 128 cannot be represented in type 'long' Fixes: 20054/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5686385113825280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ilbc: Add missing #if for muxerMichael Niedermayer2020-04-07
| | | | | | | | Fixes: building without muxers Fixes: 21594 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/webmdashenc: Use AVCodecDescriptors for codec namesAndreas Rheinhardt2020-04-07
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webmdashenc: Check codec typesAndreas Rheinhardt2020-04-07
| | | | | | | | | | | | | The WebM DASH Manifest muxer only supports VP8, VP9, Vorbis and Opus, but there was no check for this. The codec type is used to get a pointer to a string containing the codec name or NULL if it is not one of those four codecs. Said pointer has then been used without further checks as string for the %s conversion specifier in an avio_printf()) call which is undefined behaviour. This commit adds a check for the supported codec types. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* mov: Support fake moov boxes disguised as hoovVittorio Giovara2020-04-07
| | | | | | | | | | | | | | Some broken apps generate files that have a fake box named 'hoov' instead of a proper 'moov' one. This is speculation but it seems like this box contains data to be modified later (eg as file grows in size, data gets re-written) and its name is supposed to be changed to 'moov' once it can be used as a 'moov', but for some reason this step is skipped. Since this is not the first time this happens ('moov' boxes can be found in 'free' ones) extend the existing hacks to search for the moov in such boxes and skip the moov_retry since it needs to be found right away. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* hwcontext_vulkan: only use one semaphore per imageLynne2020-04-07
| | | | | | The idea was to allow separate planes to be filtered independently, however, in hindsight, literaly nothing uses separate per-plane semaphores and it would only work when each plane is backed by separate device memory.