| Branch: | Revision:

ffmpeg / libavformat / utils.c @ 2f35beae

History | View | Annotate | Download (123 KB)

# Date Author Comment
2f35beae 02/09/2011 02:31 AM Reimar Döffinger

Make av_set_pts_info keep previous time base if new one is invalid.

Fixes issue 2475.

Signed-off-by: Ronald S. Bultje <>
(cherry picked from commit b3190529dfefe3226302b23e76e16c631cde6649)

4ed68fdf 02/06/2011 07:31 PM Martin Storsjö

libavformat: Add a function for freeing an AVFormatContext

This function is useful for freeing data structures allocated by
muxers, which currently have to be freed manually by the caller.

Signed-off-by: Ronald S. Bultje <>
(cherry picked from commit f124b087eea442b65d809582527dfb5092a3463c)

2d9fd181 02/06/2011 07:31 PM Peter Ross

add ff_index_search_timestamp and ff_add_index_entry

Signed-off-by: Ronald S. Bultje <>
(cherry picked from commit e6fb5a4f78a67ed815e39ba8ac3893fd631b9b1a)

d20d1449 01/26/2011 02:43 AM Diego Elio Pettenò

Make ff_interleave_compare_dts static to utils.c.

Signed-off-by: Janne Grunau <>
(cherry picked from commit 101e1f6ff90c3365bfde05469ae26d2ee7f71f3e)

440d761e 01/11/2011 12:17 PM Stefano Sabatini

Clarify timestamps related error messages in compute_pkt_fields2().

Originally committed as revision 26308 to svn://

6cbce636 01/06/2011 03:30 AM Daniel Kang

Fix assertion fail on audio files with invalid sample rates,
fixes issue 2475.

Patch by Daniel Kang, daniel.d.kang at gmail

Originally committed as revision 26240 to svn://

6bbdba08 01/06/2011 01:11 AM Stefano Sabatini

Revert previous commit, as it was not meant to be pushed.

Originally committed as revision 26239 to svn://

7820147e 01/06/2011 01:01 AM Stefano Sabatini

Issue more explicit error messages in compute_pkt_fields2().

Originally committed as revision 26238 to svn://

81bd4119 01/06/2011 01:01 AM Stefano Sabatini

In av_close_input_stream(), flush the packet queue before to actually
close the stream.

This way the flushed packets can still reference the still unclosed
format context.

In particular this fixes a spurious error issued when closing the
video4linux2 buffer in mmap_release_buffer(), which tries to access...

cf99e4aa 01/02/2011 10:52 AM Anssi Hannula

Add AVOption support for muxers.

Patch by Anssi Hannula, anssi d hannula a iki d fi

Originally committed as revision 26195 to svn://

9128ae08 12/27/2010 09:08 AM Nicolas George

Implement av_find_best_stream.

Originally committed as revision 26104 to svn://

bb62d5c1 12/27/2010 07:46 AM Anton Khirnov

Allow output formats without any streams.

Required for future metadata format.

Originally committed as revision 26100 to svn://

141de5a9 12/26/2010 01:24 AM Peter Ross

add ff_find_stream_index

Originally committed as revision 26092 to svn://

9100d4d6 12/20/2010 09:58 AM David Czech

Fix crash if invalid bit-rate was read from file.
Fixes issue 2426.

Patch by David Czech, davidczech510 gmail

Originally committed as revision 26061 to svn://

118ccae0 12/04/2010 02:46 PM Aurelien Jacobs

add subtitle codec autodetection

Originally committed as revision 25884 to svn://

581ba2ce 11/25/2010 02:19 AM Baptiste Coudurier

In av_find_stream_info, decode more h264 to get correct delay, issue #2020

Originally committed as revision 25824 to svn://

6bfc2683 11/21/2010 10:24 AM Reimar Döffinger

Add av_append_packet function, to be used in code that merges packets
to allow palette handling without using PaletteControl.

Originally committed as revision 25777 to svn://

b3c0fc76 11/16/2010 11:50 PM Aurelien Jacobs

av_find_stream_info(): set subtitle codec time_base

Originally committed as revision 25758 to svn://

cb2c971d 11/13/2010 01:57 PM Aurelien Jacobs

allow passing subtitles header between decoder and encoder

Originally committed as revision 25745 to svn://

27323146 11/13/2010 08:55 AM Anton Khirnov

lavf/utils: use av_{i/o}format_next() instead of first_{i/o}format

Originally committed as revision 25738 to svn://

5d6e4c16 11/12/2010 11:04 AM Stefano Sabatini

Replace deprecated symbols SAMPLE_FMT_* with AV_SAMPLE_FMT_*, and enum
SampleFormat with AVSampleFormat.

Originally committed as revision 25730 to svn://

d60a9f52 10/16/2010 01:07 PM Anton Khirnov

lavf: simplify setting the encoder ident tag.
patch by Anton Khirnov anton at khirnov dot net

Originally committed as revision 25504 to svn://

13728334 10/15/2010 06:25 PM Aurelien Jacobs

add FF_API_SYMVER define to disable symver compatibility functions

Originally committed as revision 25491 to svn://

114c9a59 10/15/2010 02:25 PM Aurelien Jacobs

add FF_API_FIRST_FORMAT define to drop deprecated first_?format from public api

Originally committed as revision 25489 to svn://

d87a521c 10/15/2010 01:33 PM Aurelien Jacobs

add FF_API_PARSE_FRAME_PARAM define to disable the deprecated
parse_image_size() and parse_frame_rate() public functions

Originally committed as revision 25485 to svn://

88e44314 10/15/2010 12:54 PM Aurelien Jacobs

add FF_API_URL_SPLIT define to disable the deprecated ff_url_split() function

Originally committed as revision 25482 to svn://

198ac67f 10/15/2010 12:45 PM Aurelien Jacobs

add FF_API_GUESS_FORMAT define to disable the deprecated guess_format()
and guess_stream_format() public functions

Originally committed as revision 25480 to svn://

fd0368e7 10/08/2010 10:01 PM Aurelien Jacobs

move av_find_stream_info() info struct to AVStream to avoid messy (re)allocation

Originally committed as revision 25418 to svn://

e99179de 10/07/2010 07:10 PM Aurelien Jacobs

remove useless local variable

Originally committed as revision 25394 to svn://

3e4318bf 10/07/2010 07:05 PM Aurelien Jacobs

remove useless local allocated start_time array

Originally committed as revision 25393 to svn://

61138c43 10/06/2010 09:43 PM Aurelien Jacobs


Originally committed as revision 25382 to svn://

38aab35f 10/06/2010 08:56 PM Aurelien Jacobs

add new streams API without MAX_STREAMS limit
(disabled until next major bump)

Originally committed as revision 25381 to svn://

feb2440c 10/06/2010 08:52 PM Aurelien Jacobs

dynamically use nb_streams instead of static use of MAX_STREAMS

Originally committed as revision 25380 to svn://

6612d8cf 10/06/2010 08:21 PM Reimar Döffinger

Move handling of ID3v2 to common utils.c code, reducing code duplication
and supporting it for more formats, fixing issue 2258.

Originally committed as revision 25378 to svn://

eb99f179 10/05/2010 07:33 PM Martin Storsjö

find_info_tag: Make sure the output buffer is null terminated

Originally committed as revision 25353 to svn://

62784e37 10/02/2010 10:18 PM Benjamin Larsson

Add the CODEC_CAP_CHANNEL_CONF capability code and add
that flag to the dca codec. This capability when set
will make sure the codec will initialize the channel
configuration instead of trusting the container. This
fixes issue 2137 and issue 850.

Originally committed as revision 25320 to svn://

59cb40b9 09/27/2010 10:17 PM Michael Chinen

Fix index_entries pos:
It was being set wrong for files with data_offset > 0

Patch by Michael Chinen, mchinen gmail

Originally committed as revision 25239 to svn://

6ed04040 09/26/2010 02:25 PM Michael Niedermayer

Move AVOptions from libavcodec to libavutil

Originally committed as revision 25210 to svn://

b163078f 09/07/2010 09:06 PM Christian d'Heureuse

Fix formatting for negative start times (issue 2139).

Patch by Christian d'Heureuse, chdh inventec ch

Originally committed as revision 25063 to svn://

b004207d 09/05/2010 10:25 PM Aurelien Jacobs

move stream info arrays into a struct to ease future dynamic allocation

Originally committed as revision 25045 to svn://

668338c5 08/24/2010 03:08 PM Måns Rullgård

avformat: free decryption key in av_close_input_stream()

Originally committed as revision 24899 to svn://

f9c399c4 08/19/2010 02:49 PM Martin Storsjö

Make parse_key_value from httpauth a common lavf internal function

Originally committed as revision 24832 to svn://

54036be1 08/18/2010 08:34 PM Aurelien Jacobs

rename LAVF_API_* defines to FF_API_* to clarify that it is not public API

Originally committed as revision 24825 to svn://

dd872bf4 08/17/2010 08:23 PM Aurelien Jacobs

add LAVF_API_OLD_METADATA define to disable the deprecated metadata API

Originally committed as revision 24818 to svn://

d2064fd4 08/12/2010 12:35 AM Baptiste Coudurier

Fix segv when stream copy and validate_tag fails, st->codec->codec is not set

Originally committed as revision 24782 to svn://

ec973f45 08/10/2010 05:27 PM Przemysław Sobala

Fix mem leak when trying to open a non-existing image file (issue 2126).

Patch by Przemysław Sobala, psobala wp-sa pl

Originally committed as revision 24757 to svn://

311baee7 08/09/2010 10:05 AM Martin Storsjö

Make hex_to_data a lavf internal function

This is useful for other future RTP depacketizers

Originally committed as revision 24747 to svn://

126b638e 07/26/2010 11:12 PM Stefano Sabatini

Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate()
in favor of the newly added corresponding functions
av_parse_video_size() and av_parse_video_rate() defined in

This change also adds a linking-time dependency of libavcodec and of...

9d3fdf20 07/03/2010 03:15 AM Baptiste Coudurier

Move AVStream->codec_info_nb_frames increment after try_decode_frame

Originally committed as revision 24017 to svn://

ae447836 07/03/2010 03:07 AM Baptiste Coudurier

In av_find_stream_info, decode at least 4 h.264 frames to be able to guess delay.

Originally committed as revision 24014 to svn://

b0a18c2f 06/30/2010 11:01 PM XBMC

Make "invalid dts/pts combination" a debug instead of a warning message.

Patch by XBMC

Originally committed as revision 23919 to svn://

49bd8e4b 06/30/2010 03:38 PM Måns Rullgård

Fix grammar errors in documentation

Originally committed as revision 23904 to svn://

22d78b05 06/28/2010 08:04 AM Eli Friedman

Fix an "assignment from incompatible pointer type" warning in av_read_frame_internal

Patch by Eli Friedman, eli dot friedman at gmail

Originally committed as revision 23842 to svn://

f3bfe388 06/27/2010 02:16 PM Måns Rullgård

Make ff_url_split() public

ff_url_split() is retained as an alias, as it was used by ffserver,
to avoid breaking ABI compatibility with it.

Originally committed as revision 23822 to svn://

5be5d28c 06/22/2010 08:48 AM Stephen Dredge

Fix failure in av_read_frame on timestamp rollover.

Patch by Stephen Dredge, sdredge A tpg com au

Originally committed as revision 23699 to svn://

a955fc5e 06/19/2010 09:56 PM Martin Storsjö

ff_url_join: Don't add any at-char if the auth is an empty string

Originally committed as revision 23650 to svn://

b462d132 06/15/2010 01:26 PM Måns Rullgård

Add compatibility wrappers for functions moved from lavf to lavc

When symbol versioning is enabled, moving symbols from one library to
another breaks binary compatibility. This adds wrappers with the old
version tag for the av_*packet functions recently moved to lavc....

7686ab07 06/05/2010 11:13 PM Michael Niedermayer

Fix muxing rgb rawvideo in avi regression.

Originally committed as revision 23500 to svn://

b603ab8d 06/02/2010 10:54 AM Stefano Sabatini

Make the error message issued in case of invalid codec tag more

Originally committed as revision 23423 to svn://

b742a12e 06/01/2010 07:49 PM Michael Niedermayer

Print an error when MAX_STREAMS is reached.

Originally committed as revision 23413 to svn://

a5266a47 05/27/2010 05:11 PM Michael Niedermayer

Make sure that when the parser is feeded with frame==packet that the
packets are passed through and wont be marked as static which would
require them to be copied by av_dup_packet().

Originally committed as revision 23352 to svn://

74a6df59 05/26/2010 04:20 AM Alex Converse

Add an AVSTREAM_PARSE_FULL_ONCE parsing mode to parse headers and combine packets once and only once.

Originally committed as revision 23332 to svn://

9bbe9a0d 05/24/2010 04:42 PM Jai Menon

Display a more descriptive log message when probe buffer limit is

Originally committed as revision 23288 to svn://

e1745e2f 05/22/2010 09:52 PM Stefano Sabatini

Make av_write_header() return AVERROR rather than -1 if the
input parameters are not valid.

Originally committed as revision 23253 to svn://

cf5b33d9 05/22/2010 09:52 PM Stefano Sabatini

Store in a dedicated array the format name - codec id - codec type
mapping. Simplify.

Originally committed as revision 23252 to svn://

83c27079 05/22/2010 03:56 PM Stefano Sabatini

Prefer enum CodecID over int in ff_codec_get_tag().

Originally committed as revision 23249 to svn://

9a761250 05/21/2010 07:07 AM Martin Storsjö

Add a libavformat internal function ff_write_chained

Originally committed as revision 23207 to svn://

698f4cc7 05/18/2010 07:23 PM Francesco Lavra

Validate AVCodecTag vs CodecID.

Patch by Francesco Lavra, francescolavra interfree it

Originally committed as revision 23159 to svn://

603a5f04 05/18/2010 07:16 PM Francesco Lavra

Factorize some code into the new function ff_toupper4().

Patch by Francesco Lavra, francescolavra interfree it

Originally committed as revision 23158 to svn://

58edb075 05/14/2010 10:04 PM Baptiste Coudurier

Change MAX_READ_SIZE message during av_find_stream_info to DEBUG level.
It is not harmful and it scares too many users.

Originally committed as revision 23139 to svn://

8e2ee182 05/01/2010 01:49 PM Reimar Döffinger

Export av_probe_input_format2.

Originally committed as revision 23002 to svn://

2ef6c124 04/25/2010 02:27 PM Stefano Sabatini

Mark av_metadata_set() as deprecated, and use av_metadata_set2()
in its place.

av_metadata_set() is going to be dropped at the next major bump.

Originally committed as revision 22961 to svn://

ba87f080 04/20/2010 02:45 PM Diego Biurrun

Remove explicit filename from Doxygen @file commands.

Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.

Originally committed as revision 22921 to svn://

2898526d 04/13/2010 07:25 AM Jean-Daniel Dupas

Do not probe when the format is known.
Patch by Jean-Daniel Dupas devlists shadowlab org

Originally committed as revision 22870 to svn://

0f1f4816 04/11/2010 12:43 AM Michael Niedermayer

Raise needed score for codec probing in CODEC_ID_PROBE before the last packet.
Fixes issue1871

Originally committed as revision 22831 to svn://

497431a5 04/09/2010 10:39 PM Michael Niedermayer

Dont try to compute AVPacket duration for possibly interlaced video codecs
when no parser is available.
This partly fixes the frame rate misdetection in issue1756.

Originally committed as revision 22824 to svn://

01d91b9b 04/08/2010 09:02 AM Tomas Härdin

Reusing the probe buffer to rewind the ByteIOContext in ff_probe_input_buffer() instead of seeking back to the start of the file. Once exhausted, the size of the buffer is reduced.

Originally committed as revision 22821 to svn://

0e1f78f9 04/04/2010 10:19 PM Michael Niedermayer

Fix rounding direction for calculation of AVPacket.duration.
Fixes issue1579

Originally committed as revision 22802 to svn://

ccf8c294 04/01/2010 12:09 PM Michael Niedermayer

Limit probing to probesize.

Originally committed as revision 22758 to svn://

fe8344a2 03/31/2010 12:55 PM Michael Niedermayer


Originally committed as revision 22745 to svn://

cc947f04 03/31/2010 12:29 PM Jean-Daniel Dupas

Replace all occurences of PKT_FLAG_KEY with AV_PKT_FLAG_KEY.

Patch by Jean-Daniel Dupas, devlists shadowlab org

Originally committed as revision 22744 to svn://

46da7fa1 03/31/2010 10:45 AM Joakim Plate

Probe aac codecs for CODEC_ID_PROBE.

Patch by Joakim Plate, elupus ecce se

Originally committed as revision 22742 to svn://

72415b2a 03/30/2010 11:30 PM Stefano Sabatini

Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://

532aa889 03/26/2010 01:12 AM Micah F. Galizia

Fix updating condition for the probe_size variable in the internal
loop of ff_probe_input_buffer(), making sure that probe_size is always
set to probe_max_size in the last iteration.

Also make the function return an error if we get to the max probe
length and still cannot figure out what the format is....

d8f92957 03/25/2010 07:14 AM Martin Storsjö


Originally committed as revision 22666 to svn://

ddbeb954 03/25/2010 07:13 AM Martin Storsjö

Add a lowercase parameter to ff_data_to_hex

Originally committed as revision 22665 to svn://

2928b83c 03/21/2010 04:34 PM Stefano Sabatini

Make av_open_input_file() return AVERROR_INVALIDDATA rather than
AVERROR_NOFMT if the format is unknown / cannot be recognized.

It is returned AVERROR_INVALIDDATA, in the sense that the data is
invalid within what the specific libav* binary supports.

That was the last remaining use of AVERROR_NOFMT, which is going to be...

c7f625ee 03/16/2010 09:45 PM Måns Rullgård

Fix erroneous behaviour when format probe hits end of file

If the format probe hits end of file, do not add the error code
to the buffer position. This is obviously wrong, and with a
small input file would cause a negative buffer overflow.

Fixes issue 1818....

972ffe62 03/15/2010 11:15 PM Aurelien Jacobs

rename av_read_frame_flush to ff_read_frame_flush
it is an internal function, not part of public API

Originally committed as revision 22562 to svn://

588af13f 03/15/2010 11:14 PM Aurelien Jacobs

rename av_program_add_stream_index to ff_program_add_stream_index
it is an internal function, not part of public API

Originally committed as revision 22561 to svn://

2dad0dce 03/15/2010 10:36 AM Martin Storsjö

Move the NTP offset definitions to internal.h

Originally committed as revision 22542 to svn://

eadd495d 03/14/2010 10:40 PM Micah F. Galizia

Move the probe loop from av_open_input_file() into its own method
av_probe_input_buffer() so that it can be reused. Here are a few
differences to the original way things were probed:

- maximum probe buffer size can be specified as a parameter.

- offset within the stream to probe from can be specified as a parameter....

594a9aeb 03/10/2010 10:21 PM Martin Storsjö

Make the ntp_time function available to other parts of libavformat, as ff_ntp_time

Originally committed as revision 22438 to svn://

67c10de7 03/09/2010 03:19 PM Michael Niedermayer

Add special case to avoid binary search when appending index entries.

Originally committed as revision 22400 to svn://

f4495cdc 03/08/2010 11:51 PM Stefano Sabatini

Remove definition of match_ext(), which is declared under #ifdef
HAVE_AV_CONFIG_H and so not publicly declared, and currently unused.

Originally committed as revision 22353 to svn://

f984dcf6 03/08/2010 09:05 AM Martin Storsjö


Originally committed as revision 22322 to svn://

c5c6e67c 03/08/2010 09:03 AM Martin Storsjö

Rename url_split to ff_url_split

Since this function isn't in the public API, it should have an ff_ prefix.

Originally committed as revision 22321 to svn://

f19341e1 03/08/2010 03:46 AM Måns Rullgård

Revert "Move the probe loop from av_open_input_file() into its own method"

This reverts r22296. This change made some files to fail to open.
The patch submitter has promised to investigate next week.

Originally committed as revision 22315 to svn://

e7e291e9 03/08/2010 12:00 AM Alex Converse

av_find_stream_info(): Add a workaround for backwards compatible HE-AAC signaling.

The sample rate, frame size, and channel count from the container are
not reliable when backwards compatible signaling is used.

Originally committed as revision 22301 to svn://

663322c1 03/07/2010 11:10 PM Daniel Kristjansson

Fix pts->dts conversion init for non-zero initial value for pts.

Patch by Daniel Kristjansson, danielk cuymedia net

Originally committed as revision 22297 to svn://