Commit Graph

791 Commits

Author SHA1 Message Date
Anton Khirnov c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Anton Khirnov 2092232581 lavf: estimate frame duration from r_frame_rate.
If r_frame_rate is set, it should be more reliable for this than either
codec or stream timebase.
2011-11-30 07:47:43 +01:00
Janne Grunau 0945eddec0 pthread: do not touch has_b_frames
Adding the thread count in frame level multithreading to has_b_frames
as an additional delay causes more problems than it solves.
For example inconsistent behaviour during timestamp calculation in
libavformat.
Thread count and frame level multithreading are both set by the user.
If the additional delay caused by frame level multithreading needs
to be considered in the calling code it has all information to take
it into account.
Should it become necessary to calculate a maximum delay inside
libavcodec it should be exported as its own field and not reusing
an existing field.

Based on a patch by Michael Niedermayer.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-11-22 09:50:33 +01:00
Martin Storsjö 18579f08e7 avformat: Accept the ISO8601 separate format as input, too
This makes the function accept the format of creation_time
as output by demuxers (e.g. the mov demuxer), making the
creation timestamp stay intact if transcoding.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-16 11:22:43 +02:00
Martin Storsjö 4a83541650 avformat: Interpret times in ff_iso8601_to_unix_time as UTC
This function is used in muxers for parsing the 'creation_time'
metadata key, for converting it to a time value.

This makes it match the behaviour of the exported 'creation_time'
metadata from demuxers, where it is in UTC, too.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-16 11:22:42 +02:00
Mans Rullgard 52767d891c lavf: fix multiplication overflow in avformat_find_stream_info()
Converting to double before the multiplication rather than after
avoids an integer overflow in some cases.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-15 23:41:04 +00:00
Anton Khirnov 32caa7b13c lavf: pass options from AVFormatContext to avio. 2011-11-13 13:21:46 +01:00
Martin Storsjö 9d77a8faf9 avformat: Use avio_open2, pass the AVFormatContext interrupt_callback onwards
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-11-13 13:20:49 +01:00
Martin Storsjö 9957cdbfd5 avformat: Use ff_check_interrupt 2011-11-13 13:08:13 +01:00
Andrey Utkin 055a141e44 lavf: don't leak corrupted packets
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-11-09 07:30:43 +01:00
Martin Storsjö 1c8c41ff07 avformat: Avoid a warning about mixed declarations and code
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-08 01:02:14 +02:00
Martin Storsjö ce145690b6 avformat: Warn about using network functions without calling avformat_network_init
This is to make developers aware of the fact that they will
start using the new init function at some point.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-07 19:29:33 +02:00
Anton Khirnov eb0de71058 lavf: don't return from void av_update_cur_dts() 2011-11-06 19:13:28 +01:00
Reimar Döffinger bb3244dee2 Replace all usage of strcasecmp/strncasecmp
All current usages of it are incompatible with localization.
For example strcasecmp("i", "I") != 0 is possible, but would
break many of the places where it is used.

Instead use our own implementations that always treat the data
as ASCII.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:52:57 +02:00
Martin Storsjö b6d08f40aa avformat: Add functions for doing global network initialization
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-05 12:17:51 +02:00
Ronald S. Bultje 38a4be3fa7 lavf: use number of output pictures for delay checks.
This fixes false positives of has_codec_delay_been_guessed() for
streams where not every input picture generates an output picture,
such as interlaced H264.
2011-10-28 23:42:57 -07:00
Alex Converse 61856d06eb probe: Restore identification of files with very large id3 tags and no extension.
Restore behavior of identifying files with huge id3 tags as
mp3 at AVPROBE_SCORE_MAX/4. This was broken in r25378 and subsequently
removed in r25929.
2011-10-28 15:44:10 -07:00
Alex Converse 7a773d4d59 probe: Remove id3 tag presence as a criteria to do file extension checking.
This only encourages our users to put id3v2 tags on non-mp3 files to opt
into extension based probing.
2011-10-28 15:44:09 -07:00
Anton Khirnov a2faa95151 lavf: make some seeking functions private
Specifically av_update_cur_dts(), av_seek_frame_binary() and
av_gen_search().

They are not supposed to be called outside lavf.
2011-10-28 09:23:24 +02:00
Anton Khirnov a75034300f lavf: simplify by using FFMAX/FFMIN. 2011-10-25 16:28:52 +02:00
Anton Khirnov 0842d58998 lavc: use avpriv_ prefix for ff_toupper4.
It's used in lavf.
2011-10-20 21:06:58 +02:00
Anton Khirnov 1fa395e471 lavf: use avpriv_ prefix for ff_new_chapter().
It's used in libavdevice.
2011-10-20 20:57:23 +02:00
Justin Ruggles 9ef6c7977f avformat: do not require frame_size for Speex.
Having it there forces decoding of a frame in order to get frame_size, but it
is not really needed for proper demuxing or decoding.
2011-10-20 13:06:16 -04:00
Anton Khirnov 569129a6dc lavf: add avformat_new_stream as a replacement for av_new_stream.
It takes a codec parameter, thus enabling codec-specific defaults.
2011-10-19 17:02:11 +02:00
Anton Khirnov c10731e78b lavf: deprecate AVFormatContext.file_size
It's too unreliable to be useful. avio_size() should be called instead.
2011-10-17 08:25:38 +02:00
Justin Ruggles b631fba936 avformat: add AVInputFormat flag AVFMT_NO_BYTE_SEEK.
This will prevent seeking by bytes for formats that cannot handle this.
2011-10-13 16:31:15 -04:00
Justin Ruggles 0041cdba98 avformat: don't unconditionally call ff_read_frame_flush() when trying to seek.
This prevents flushing the packet buffer when the input format does not
support seeking.
2011-10-13 16:31:15 -04:00
Mans Rullgard a31e9f68a4 lavf: fix signed overflow in avformat_find_stream_info()
On the first iteration through this code, last_dts is always
INT64_MIN (AV_NOPTS_VALUE) and the subtraction overflows in
an invalid manner.  Although the result is only used if the
input values are valid, performing the subtraction is still
not allowed in a strict environment.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-08 20:04:22 +01:00
Martin Storsjö e81e5e8ad2 lavf: Avoid using av_malloc(0) in av_dump_format
On OS X, av_malloc(0) returns pointers that cause crashes when
freed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-30 22:31:30 +03:00
Nicolas George 4ca59d1948 oggdec: add support for Xiph's CELT codec
This patch also introduces CODEC_ID_CELT.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-09-26 13:51:29 +02:00
Mans Rullgard bb416bd68c lavf: do not set codec_tag for rawvideo
If the demuxer did not set a codec_tag, there is none and
inventing one makes no sense.  This change stops the rawvideo
"decoder" over-writing user-supplied pixfmt with one derived
from the codec_tag.  The pixfmt-codec_tag-pixfmt round-trip
is lossy since several pixfmts map to the same codec_tag.

This fixes fate-lavf-pixfmt with avfilter disabled.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-09-25 14:07:21 +01:00
Diego Biurrun 5cc2530fc2 prores: mark prores as intra-only in libavformat/utils.c:is_intra_only() 2011-09-23 01:42:14 +02:00
David Goldwich 63d64228a7 lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:03:56 +02:00
Alex Converse 940173d4d1 lavf utils: Remove write-only variable 2011-09-14 10:35:46 -07:00
Alex Converse 4439caa482 lavf utils: Rename shadowing variable 2011-09-14 10:35:42 -07:00
Alex Converse 7e6029f98a lavf utils: Fix bad indentation. 2011-08-23 09:53:23 -07:00
Anton Khirnov 48f9e457ea lavf: add avformat_query_codec().
It allows to check if a given codec can be written into a container.
2011-08-16 20:24:20 +02:00
Zohar Kelrich 73e8e8dbf9 lavf: Add an option to discard corrupted frames
Signed-off-by: Zohar Kelrich <lumimies@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-08-02 02:52:41 +02:00
Alex Converse 5ef953e84f probe: Fix insane flow control.
A loop control variable was shadowed inside the loop and never updated.
2011-07-29 09:29:44 -07:00
Stefano Sabatini 25dfda7f31 lavf: rename enc variable in utils.c:has_codec_parameters()
Rename it to "avctx", the old name was confusing as the function is
used also with decoder contexts.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-17 06:58:53 +02:00
Anton Khirnov d3bb71914b lavf/utils: drop av_ prefixes from static functions. 2011-07-15 20:27:43 +02:00
Diego Biurrun 5a819c5e23 avformat_open_input(): Add braces to shut up gcc warning.
libavformat/utils.c:599: warning: missing braces around initializer
libavformat/utils.c:599: warning: (near initialization for ‘ap.time_base’)
2011-07-14 20:45:26 +02:00
Anton Khirnov e358f7ee90 lavf: fix invalid reads in avformat_find_stream_info() 2011-07-14 03:41:24 +02:00
Anton Khirnov 13551ad1e3 lavf: fix segfault in av_open_input_stream()
ic is NULL in case of error.
2011-07-13 20:49:31 +02:00
Alex Converse a58858d60d lavf: Cleanup try_decode_frame() logic.
This fixes AAC playback in ffplay.
2011-07-13 10:39:06 -07:00
Anton Khirnov 6379900c53 Add a check for strptime().
It's an XSI extension, not available on some supported systems.
2011-07-13 12:14:27 +02:00
Anton Khirnov 001d668d40 lavf: factor out conversion of ISO8601 string to unix time 2011-07-13 12:14:25 +02:00
Anton Khirnov 71a861cf40 lavc: make avcodec_alloc_context3 officially public.
Deprecate avcodec_alloc_context/2.
2011-07-10 17:09:28 +02:00
Anton Khirnov a67c061e0f lavf: add avformat_find_stream_info()
It supports passing options to codecs.
2011-07-10 17:07:05 +02:00
Anton Khirnov 1c6d2b7df0 lavf: update AVStream.nb_frames when muxing. 2011-07-08 22:13:52 +02:00