summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAge
* avformat: replace some odd 30-60 rates by higher less odd ones in ↵Michael Niedermayer2014-11-21
| | | | | | | | get_std_framerate() Fixes Ticket4012 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Read (display) aspect ratio from mxf files.Carl Eugen Hoyos2014-11-17
| | | | Fixes ticket #4107.
* lavf/ffm: store/restore private codec contextLukasz Marek2014-11-16
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* avformat/utils: Leave skip_clear enabled until after estimate_timings()Michael Niedermayer2014-11-03
| | | | | | 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-29
| | | | | | | 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-24
| | | | | | | 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-19
| | | | | | | | 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-16
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/utils: Try to correct the codec_framerate in ↵Michael Niedermayer2014-10-16
| | | | | | | | 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-15
| | | | | | ff_compute_frame_duration() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '2d6e58497e76836604364b037df9b00ba3d75b69'Michael Niedermayer2014-10-15
|\ | | | | | | | | | | | | | | | | | | * 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-15
| |
| * lavf: Don't drop both pts and dts if timestamps are invalidMichael Niedermayer2014-10-12
| | | | | | | | | | | | | | | | | | 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-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: remove obsolete FF_API_READ_PACKET cruftJames Almer2014-10-05
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_CLOSE_INPUT_FILE cruftJames Almer2014-10-05
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_SET_PTS_INFO cruftJames Almer2014-10-05
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_NEW_STREAM cruftJames Almer2014-10-05
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: remove obsolete FF_API_FORMAT_PARAMETERS cruftJames Almer2014-10-05
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '19133e96d30e3f80dbae236ef081aedef419a6bf'Michael Niedermayer2014-09-29
|\| | | | | | | | | | | | | | | | | | | * 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-29
| | | | | | | | | | | | | | | | 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-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-20
| | | | | | | | | | | | | | | | | | | | | | | | 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-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: Exclude the header size when computing duration from bit_rateHendrik Leppkes2014-09-08
| | | | | | | | | | | | | | | | 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-26
| | | | | | | | | | | | directly above Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b263f8ffe7599d9cd27ec477a12700da8eb2790d'Michael Niedermayer2014-08-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-25
| | | | | | | | | | 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-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15
| | | | | | | | | | | | This avoids some theoretical memleaks Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix packet_buffer memory leak in avformat_free_contextAndrey Myznikov2014-08-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: eliminate ff_get_audio_frame_size()Anton Khirnov2014-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Move frame_size fallback from ff_get_audio_frame_size() to ↵Michael Niedermayer2014-08-14
| | | | | | | | | | | | 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-14
| | | | | | | | | | | | ff_get_audio_frame_size() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '481a3667495425db9fdffb653292b6460fb68208'Michael Niedermayer2014-08-14
|\| | | | | | | | | | | | | | | | | | | | | * 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-13
|\| | | | | | | | | | | | | | | | | | | * 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-13
| | | | | | | | | | | | | | 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-07
| | | | | | | | | | | | | | 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-07
| | | | | | | | | | | | | | | | 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.
* | avformat/util: change av_find_default_stream_index() to use a score based systemMichael Niedermayer2014-08-04
| | | | | | | | | | | | | | Disfavor video streams with unknown resolution and no packets Fixes seeking in audio-only-speex.flv Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Add int64_t probesize2 instead of int probesize to AVFormatContext.Carl Eugen Hoyos2014-07-30
| | | | | | | | | | Allows to set a probesize >2G. Tested-by: Oliver Fromme
* | Merge commit 'e253a9e2b3d683eb51db7c776326eb07de10ad4c'Michael Niedermayer2014-07-29
|\| | | | | | | | | | | | | | | | | | | | | * commit 'e253a9e2b3d683eb51db7c776326eb07de10ad4c': avformat: Move av_probe_input* to format.c Conflicts: libavformat/format.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Move av_probe_input* to format.cLuca Barbato2014-07-29
| |
* | Merge commit '7215fcf84032118ecd9fb54fb14154d69fea638d'Michael Niedermayer2014-07-27
|\| | | | | | | | | | | | | * commit '7215fcf84032118ecd9fb54fb14154d69fea638d': avformat: Mark AVOutputFormat argument in avformat_query_codec as const Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Mark AVOutputFormat argument in avformat_query_codec as constDiego Biurrun2014-07-26
| |
| * avformat_new_stream: make the AVCodec parameter constRoman Savchenko2014-07-08
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * Replace av_malloc() and memset(0) by av_mallocz()Diego Biurrun2014-06-22
| |
* | avformat: add av_stream_get_parser() to access avformat AVParserMichael Niedermayer2014-07-14
| | | | | | | | | | | | | | | | | | The AVStream.parser field is considered private and its location cannot be preserved while preserving also ABI compatibility to libav, as libav added fields before it. Some tools like ffmpeg.c access this field though Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: do not wait for packets from discarded streams for genptsMichael Niedermayer2014-07-13
| | | | | | | | | | | | | | Fixes long loop Fixes Ticket3208 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>