aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/utils: Do not init parser if probing is unfinishedMichael Niedermayer2015-11-261-1/+1
| | | | | | | | | | | Fixes assertion failure Fixes: 136f8b8d47af7892306625e597dee655/signal_sigabrt_7ffff6ae7cc9_8941_ab11bea57c84796418f481f873dc31ba.dvr_ms Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 1ef336e912a7a3a13a9933825a56c421f891e44b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: Reset global flag on deinitVittorio Giovara2015-05-211-0/+1
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 32da94fa7f73ac749e0a1e2f20499fad2f6f57fe) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: Ensure that AVFMT_FLAG_CUSTOM_IO is set before useMichael Niedermayer2015-04-211-0/+3
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit ba631b791435c395361e2026fc7419b341e57813) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: avoid discarded streams in av_find_default_stream_index()Michael Niedermayer2015-04-171-0/+3
| | | | | | | | | Fixes Ticket2010 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit ff6841c6bb2d35f8d461419e45d59be7542d03fe) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: Fix number suffixes in tb_unreliable()Michael Niedermayer2015-02-121-2/+2
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 4b15bba2aec93776bfdc69a1bca42a4795a7d191) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: check for malloc failurewm42015-02-121-0/+5
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit a66893ac949864352b36b39e48c4cd72bbd81e54) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a ↵Michael Niedermayer2015-01-091-0/+1
| | | | | | | | | stale pointer in memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit bbfca8e84b0e69abba523d665536c0135fc1c00e) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Add FFMPEG_VERSION into the binary libsMichael Niedermayer2014-12-221-0/+3
| | | | | | | | | This simplifies identifying from which revision a binary of a lib came from Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 649c158e8c94ac0cff7f03e97d6ea8bbf71b7f02) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: Do not update programs streams from program-less streams in ↵Michael Niedermayer2014-12-141-0/+2
| | | | | | | | | | | update_wrap_reference() Fixes Ticket3686 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit a29524bf2e197dd8d582445de0fe17f03b79f79d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: Search harder for missing stream information in flv by defaultMichael Niedermayer2014-12-011-5/+10
| | | | | | Fixes Ticket4133 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat: replace some odd 30-60 rates by higher less odd ones in ↵Michael Niedermayer2014-11-211-3/+9
| | | | | | | | get_std_framerate() Fixes Ticket4012 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Read (display) aspect ratio from mxf files.Carl Eugen Hoyos2014-11-171-0/+5
| | | | Fixes ticket #4107.
* lavf/ffm: store/restore private codec contextLukasz Marek2014-11-161-0/+2
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* avformat/utils: Leave skip_clear enabled until after estimate_timings()Michael Niedermayer2014-11-031-1/+2
| | | | | | Should make no difference but will be needed for subsequent commits Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: support more AVC Intra formats without SPS/PPS headerThomas Mundt2014-10-291-2/+40
| | | | | | | add support for AVC Intra 50 720p and 1080p without SPS/PPS header in mxf and mov demuxers. I got the SPS/PPS tables from libbmx. Reviewed-by: tomas.hardin@codemill.se Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat: Add and use ff_copy_whitelists()Michael Niedermayer2014-10-241-0/+13
| | | | | | | Fixes potential security issue in case of running out of memory Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat: Add format_whitelistMichael Niedermayer2014-10-191-0/+17
| | | | | | | | This allows restricting demuxers to a list of needed ones for improved security Note, some demuxers themselfs open other demuxers, these are only restricted if AVOptions are forwarded to them. Please check that your code does that. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/util: Simplify av_guess_frame_rate() by using AVCodecContext.framerateMichael Niedermayer2014-10-161-2/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: Try to correct the codec_framerate in ↵Michael Niedermayer2014-10-161-1/+1
| | | | | | | | ff_compute_frame_duration() for the encoding case No testcase where this makes a difference is known Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: use av_reduce() to simplify code and avoid overflow in ↵Michael Niedermayer2014-10-151-8/+9
| | | | | | ff_compute_frame_duration() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '2d6e58497e76836604364b037df9b00ba3d75b69'Michael Niedermayer2014-10-151-6/+12
|\ | | | | | | | | | | | | | | | | | | * commit '2d6e58497e76836604364b037df9b00ba3d75b69': lavf: switch to AVCodecContext.framerate for demuxing Conflicts: libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: switch to AVCodecContext.framerate for demuxingAnton Khirnov2014-10-151-6/+8
| |
| * lavf: Don't drop both pts and dts if timestamps are invalidMichael Niedermayer2014-10-121-1/+1
| | | | | | | | | | | | | | | | | | In these cases, only drop dts. Because if we drop both we have no timestamps at all for some files. This improves playback of HLS streams from GoPro cameras. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/utils: print more information with av_dlog() in compute_pkt_fields()Michael Niedermayer2014-10-131-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: remove obsolete FF_API_READ_PACKET cruftJames Almer2014-10-051-7/+0
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_CLOSE_INPUT_FILE cruftJames Almer2014-10-051-7/+0
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_SET_PTS_INFO cruftJames Almer2014-10-051-8/+0
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_NEW_STREAM cruftJames Almer2014-10-051-10/+0
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_FORMAT_PARAMETERS cruftJames Almer2014-10-051-7/+0
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '19133e96d30e3f80dbae236ef081aedef419a6bf'Michael Niedermayer2014-09-291-0/+5
|\| | | | | | | | | | | | | | | | | | | * commit '19133e96d30e3f80dbae236ef081aedef419a6bf': lavf: fix memleaks in avformat_find_stream_info() Conflicts: libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: fix memleaks in avformat_find_stream_info()Justin Ruggles2014-09-291-0/+5
| | | | | | | | | | | | | | | | When AVFMT_FLAG_NOBUFFER is set, the packets are not added to the AVFormatContext packet list, so they need to be freed when they are no longer needed. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avformat/mp3dec: avoid early EOF with concatenated gapless mp3swm42014-09-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a file created with something like: cat file1.mp3 file2.mp3 > result.mp3 Then if file2.mp3 has gapless information, result.mp3 would stop playing something in the middle. This happens because the gapless info directs the decoder to discard all samples after a certain position. To make matters worse, the gapless info of file2.mp3 will be used when playing the file1.mp3 part, because the gapless info is located at the end of the file. While handling concatenated gapless files correctly would be insane and a lot of effort (especially without scanning the whole file on opening), it's easy to prevent at least early EOF. Playback will happen to work, even if it's slightly broken. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: fix gapless audio supportwm42014-09-201-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | The code already had skipping of initial padding, but discarding trailing frame padding was missing. This is somewhat questionable, because it will make the decoder discard any data after the declared file size in the LAME header. But note that skipping full frames at the end of the stream is required. Encoders actually create such files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: free s->pb for image2 as it can be used with and without a fileMichael Niedermayer2014-09-131-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: Exclude the header size when computing duration from bit_rateHendrik Leppkes2014-09-081-1/+2
| | | | | | | | | | | | | | | | This improves the estimate for MP3s with cover art tags. Fixes Ticket2931 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: remove assert that tests the same condition as the if() ↵Michael Niedermayer2014-08-261-1/+0
| | | | | | | | | | | | directly above Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b263f8ffe7599d9cd27ec477a12700da8eb2790d'Michael Niedermayer2014-08-251-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b263f8ffe7599d9cd27ec477a12700da8eb2790d': lavf: add AVFormatContext.max_ts_probe Conflicts: doc/APIchanges libavformat/avformat.h libavformat/utils.c libavformat/version.h lavf-fate/mp3 changes as the estimated input bitrate changes and that is copied to the output Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: add AVFormatContext.max_ts_probeAnton Khirnov2014-08-251-0/+1
| | | | | | | | | | It allows to configure how long will avformat_find_stream_info() wait to get the first timestamp.
| * lavf: eliminate ff_get_audio_frame_size()Anton Khirnov2014-08-131-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is basically a wrapper around av_get_audio_frame_duration(), with a fallback to AVCodecContext.frame_size. However, that field is set only when the stream codec context is actually used for encoding or decoding, which is discouraged. For muxing, it is generally the responsibility of the caller to set the packet duration. For demuxing, if the duration is not stored at the container level, it should be set by the parser. Therefore, removing the frame_size fallback should not break any important case.
* | vformat/utils: call flush_packet_queue() from avformat_free_context()Michael Niedermayer2014-08-151-1/+1
| | | | | | | | | | | | This avoids some theoretical memleaks Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix packet_buffer memory leak in avformat_free_contextAndrey Myznikov2014-08-151-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: eliminate ff_get_audio_frame_size()Anton Khirnov2014-08-141-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is basically a wrapper around av_get_audio_frame_duration(), with a fallback to AVCodecContext.frame_size. However, that field is set only when the stream codec context is actually used for encoding or decoding, which is discouraged. For muxing, it is generally the responsibility of the caller to set the packet duration. For demuxing, if the duration is not stored at the container level, it should be set by the parser. Therefore, removing the frame_size fallback should not break any important case. (cherry picked from commit 30e50c50274f88f0f5ae829f401cd3c7f5266719) Conflicts: libavformat/utils.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Move WMA case from ff_get_audio_frame_size() to av_get_audio_frame_duration()Michael Niedermayer2014-08-141-6/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Move frame_size fallback from ff_get_audio_frame_size() to ↵Michael Niedermayer2014-08-141-4/+0
| | | | | | | | | | | | av_get_audio_frame_duration() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: Remove demuxer specific frame_size fallback from ↵Michael Niedermayer2014-08-141-4/+0
| | | | | | | | | | | | ff_get_audio_frame_size() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '481a3667495425db9fdffb653292b6460fb68208'Michael Niedermayer2014-08-141-0/+23
|\| | | | | | | | | | | | | | | | | | | | | * commit '481a3667495425db9fdffb653292b6460fb68208': cmdutils: allow matching by metadata in stream specifiers Conflicts: Changelog cmdutils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '019d3fccc4dcf5c8379112f697ce9eb08edee9b9'Michael Niedermayer2014-08-131-0/+9
|\| | | | | | | | | | | | | | | | | | | * commit '019d3fccc4dcf5c8379112f697ce9eb08edee9b9': Set protocol-level metadata in AVFormatContext any time a packet is read. Conflicts: libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Set protocol-level metadata in AVFormatContext any time a packet is read.Andrew Stone2014-08-131-0/+9
| | | | | | | | | | | | | | If any option named "metadata" is set inside the context, it is pulled up to the context and then the option is cleared. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avcodec/raw: add avpriv_get_raw_pix_fmt_tags()James Almer2014-08-071-1/+1
| | | | | | | | | | | | | | Used to expose ff_raw_pix_fmt_tags[] to other libav* libraries Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Do not return a probe score from set_codec_from_probe_data() if the codec ↵Carl Eugen Hoyos2014-08-071-2/+2
| | | | | | | | | | | | | | | | was ignored. This is a workaround for the issue that stream probing can use the score of another codec type for mpeg stream autodetection. Fixes ticket #3821.