summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAge
* 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>
* | avformat/mpegts: dont clear programs during probingMichael Niedermayer2014-07-12
| | | | | | | | | | | | Fixes Ticket 3763 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mpegts: skip updating programs/streams when determining durationMichael Niedermayer2014-07-11
| | | | | | | | | | | | Fixes Ticket2441 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: better probing for duration in estimate_timings_from_pts()Gaullier Nicolas2014-06-19
| | | | | | | | | | | | It seems it is more secure to simply duplicate the computing routine from compute_pkt_fields to estimate_timings_from_pts. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '194be1f43ea391eb986732707435176e579265aa'Michael Niedermayer2014-06-18
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '194be1f43ea391eb986732707435176e579265aa': lavf: switch to AVStream.time_base as the hint for the muxer timebase Conflicts: doc/APIchanges libavformat/filmstripenc.c libavformat/movenc.c libavformat/mxfenc.c libavformat/oggenc.c libavformat/swf.h libavformat/version.h tests/ref/lavf/mkv Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: switch to AVStream.time_base as the hint for the muxer timebaseAnton Khirnov2014-06-18
| | | | | | | | | | | | | | | | | | | | | | | | Previously, AVStream.codec.time_base was used for that purpose, which was quite confusing for the callers. This change also opens the path for removing AVStream.codec. The change in the lavf-mkv test is due to the native timebase (1/1000) being used instead of the default one (1/90000), so the packets are now sent to the crc muxer in the same order in which they are demuxed (previously some of them got reordered because of inexact timestamp conversion).
* | Merge commit '2dc265619a2fc9c6f9aff7ac2bcdbcb90e9610cb'Michael Niedermayer2014-06-16
|\| | | | | | | | | | | | | | | | | | | * commit '2dc265619a2fc9c6f9aff7ac2bcdbcb90e9610cb': lavf: group dump functions together Conflicts: libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: group dump functions togetherVittorio Giovara2014-06-14
| |
* | Merge remote-tracking branch 'cehoyos/master'Michael Niedermayer2014-06-10
|\ \ | | | | | | | | | | | | | | | | | | * cehoyos/master: Allow values >31bit for -analyzeduration. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * | Allow values >31bit for -analyzeduration.Carl Eugen Hoyos2014-06-10
| | |
* | | avformat/utils: dont wait for a first dts on demuxers which have ↵Michael Niedermayer2014-06-10
|/ / | | | | | | | | | | AVFMT_NOTIMESTAMPS set Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils/avformat_find_stream_info: Move max_analyze_duration setup ↵Michael Niedermayer2014-06-02
| | | | | | | | | | | | out of the packet loop Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/utils: Call ff_rfps_add_frame() only for videoMichael Niedermayer2014-06-02
| | | | | | | | | | | | This avoids some unneeded computations Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Report "unknown codec" instead of "unspecifed size" if the codec is unknown.Carl Eugen Hoyos2014-06-02
| |
* | Use rc_max_rate in av_find_best_stream() if bitrate == 0.Carl Eugen Hoyos2014-05-31
| | | | | | | | Fixes ticket #2042.