Commit Graph

803 Commits

Author SHA1 Message Date
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
Mans Rullgard 0ebcdf5cda Do not include mathematics.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Anton Khirnov 4f731c4429 lavf: restore old behavior for custom AVIOContex with an AVFMT_NOFILE format.
av_open_input_stream used to allow this, even though it makes no sense.
Make it just print a warning instead of failing, thus restoring
compatibility.

Note that avformat_open_input() will still reject this combination.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-02 08:41:57 +02:00
Anton Khirnov 5001d6ef4a lavf: use the correct pointer in av_open_input_stream(). 2011-07-02 08:41:57 +02:00
Benjamin Larsson dafaef2fe1 Add support for aac streams in mp4/mov without extradata. 2011-06-30 10:10:26 -07:00
Ami Fischman 59ca3955fb av_find_stream_info: simplify EAGAIN handling.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-06-29 15:27:55 -07:00
Ronald S. Bultje dbafb0e06f lavf: prevent crash in av_open_input_file() if ap == NULL.
Needed for proper behaviour in our old API compatibility code.
2011-06-18 17:51:10 -04:00
Anton Khirnov 84bd2b4bf5 lavf: add a forgotten NULL check in convert_format_parameters(). 2011-06-18 17:42:44 +02:00
Anton Khirnov 25de5958c8 lavf: add avformat_write_header() as a replacement for av_write_header().
It supports more convenient setting of AVOptions.
2011-06-16 20:24:56 +02:00
Anton Khirnov 603b8bc2a1 Deprecate av_open_input_* and remove their uses.
Deprecate the last remaining member of AVFormatParameters.
2011-06-16 20:24:56 +02:00
Anton Khirnov 05e84c95c7 lavf: add avformat_open_input() as a replacement for av_open_input_*
Add support for demuxer private options.
2011-06-16 20:24:56 +02:00
Diego Biurrun 35bdaf3d42 utils: Drop pointless '#if 1' preprocessor directive. 2011-06-13 23:02:28 +02:00
Michael Niedermayer a8fd2f4e02 lavf: initialise reference_dts in av_estimate_timings_from_pts.
Fixes issue2437.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-13 20:46:06 +02:00
Diego Biurrun 919d7a345a Replace DEBUG_SEEK/DEBUG_SI + av_log combinations by av_dlog. 2011-06-10 19:12:14 +02:00
Stefano Sabatini 996bbdbf1f lavf: make compute_pkt_fields2() return meaningful error values
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-09 23:00:11 +02:00
Anton Khirnov dbaba52ed2 lavf: don't try to free private options if priv_data is NULL.
This might happen if there was an error before priv_data was allocated
and result in segfault.
2011-06-08 19:51:31 +02:00
Anton Khirnov d2d67e424f Remove all uses of now deprecated metadata functions. 2011-06-08 07:43:45 +02:00
Anton Khirnov 367732832f lavf,lavc: free avoptions in a generic way.
It's simpler and less error-prone.

Fixes some memleaks along the way.
2011-06-05 15:01:36 +02:00
Mans Rullgard 5e1166b31b Mark some variables with av_unused
Most of these variables are only used in av_dlog statements, some
are required but not used by other macros.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-03 12:59:05 +01:00
Anton Khirnov 9749cdf775 lavf: initialize demuxer private options. 2011-05-26 20:03:26 +02:00
Alex Converse 30315a8d9c avformat: Add fpsprobesize as an AVOption. 2011-05-25 12:34:46 -07:00
John Stebbins 656566d7a4 Fix end time of last chapter in compute_chapters_end
Parenthesis are misplaced in calculation of max_time.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-25 15:55:48 +02:00
Vladimir Pantelic 69fa23961e asfdec: do not fall back to binary/generic search
asf_read_seek() inside the asf demuxer already does the
right thing, it tries the index and if that fails it uses
binary search. If binary search is called from outside of asfdec.c
it will fail because the asf code cannot clean up after itself.
Therefore introduce AVFMT_NOBINSEARCH that prevents the seek
code to fallback to binary search and AVFMT_NOGENSEARCH that
prevents the seek code to fallback to generic search.
2011-05-17 22:06:00 +02:00
Stefano Sabatini 4ad0693edc lavf: fix function name in compute_pkt_fields2 av_dlog message
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-12 18:02:28 +02:00
Marton Balint 2c71581698 lavf: fix av_find_best_stream when providing a wanted stream.
In the main loop, stream_number is incremented after checking the stream type,
so the search usually will not find the wanted stream.

This patch eliminates the useless stream_number variable and introduces a new
one, called real_stream_index to store the real stream index of the current
stream, no matter if we are looping through all the streams or only the streams
of a program.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-12 18:02:27 +02:00
Marton Balint 6b35a795f8 lavf: fix av_find_best_stream when decoder_ret is given and using a related stream.
Yet another fix for the code originally designed for use without related_stream.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-12 18:02:27 +02:00
Vitor Sessak ecc297308f lavf/utils: fix ff_interleave_compare_dts corner case.
This should fix behavior introduced by commit
96573c0d76. Av_rescale_rnd() is not
lossless so if two timestamps are equal after being rescaled they are
not always actually identical. This patch use av_compare_ts() to get
always a correct result.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-10 07:53:19 -04:00
Stefano Sabatini 975a1447f7 Replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-02 12:18:44 +02:00
Anssi Hannula 7c152a458d lavf: inspect more frames for fps when container time base is coarse
As per issue2629, most 23.976fps matroska H.264 files are incorrectly
detected as 24fps, as the matroska timestamps usually have only
millisecond precision.

Fix that by doubling the amount of timestamps inspected for frame rate
for streams that have coarse time base. This also fixes 29.970 detection
in matroska.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 78431098f9)

Tested with mplayer based on this report
http://thread.gmane.org/gmane.comp.video.mplayer.user/66043/focus=66063

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-04-29 22:46:13 +02:00
Diego Biurrun 045dd4b928 Replace some commented-out debug printf() / av_log() messages with av_dlog(). 2011-04-29 17:27:01 +02:00
Stefano Sabatini 79157f400b error: remove AVERROR_NUMEXPECTED
AVERROR_NUMEXPECTED is used only in the image muxer and demuxer, and
has a too much specific meaning, which is better explained through a
log message. Thus it can be replaced by AVERROR(EINVAL).

This breaks API.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-21 07:10:16 +02:00
Martin Storsjö 7bbb67d580 libavformat: Free AVFormatContext->streams
After switching this from a statically allocated array to a
dynamically allocated one in the major bump, this needs explicit
freeing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-20 15:42:55 +03:00
Stefano Sabatini 59d96941f0 avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols
Make AVIO_FLAG_ access constants work as flags, and in particular fix
the behavior of functions (such as avio_check()) which expect them to
be flags rather than modes.

This breaks API.
2011-04-19 19:47:58 +02:00
Anton Khirnov 5763e63913 lavf: remove FF_API_SYMVER cruft 2011-04-19 18:28:39 +02:00
Anton Khirnov b4c5acabb9 lavf: remove FF_API_FIRST_FORMAT cruft 2011-04-19 18:28:39 +02:00
Anton Khirnov 58d5ff0abf lavf: remove FF_API_PARSE_FRAME_PARAM cruft 2011-04-19 18:28:39 +02:00
Anton Khirnov 5048e36c99 lavf: remove FF_API_URL_SPLIT cruft 2011-04-19 18:28:38 +02:00
Anton Khirnov 61573bf1ba lavf: remove FF_API_GUESS_FORMAT cruft 2011-04-19 18:28:38 +02:00
Anton Khirnov 575c18da1b lavf: remove FF_API_OLD_METADATA cruft 2011-04-19 18:28:38 +02:00
Anton Khirnov 761ad42968 lavf: remove FF_API_MAX_STREAMS cruft 2011-04-19 18:28:38 +02:00
Vitor Sessak 96573c0d76 lavf/utils.c: Order packets with identical PTS by stream index.
This allows for more reproducible results when using multi-threading.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-04-12 19:06:26 -04:00
Anton Khirnov ff1ec0c3f8 avio: undeprecate av_url_read_fseek/fpause under nicer names
It seems their replacements won't be ready anytime soon.
2011-04-12 19:17:05 +02:00
Anton Khirnov a9bf9d8e53 lavf: make av_guess_image2_codec internal
It doesn't look very useful as a public function.
2011-04-08 16:44:29 +02:00
Anton Khirnov c5704b2b9a lavf: mark av_pkt_dump(_log) for remove on $next+1 bump. 2011-04-08 15:44:09 +02:00
Anton Khirnov 5cec897105 avio: move extern url_interrupt_cb declaration from avio.h to url.h 2011-04-07 18:11:24 +02:00
Anton Khirnov f87b1b373a avio: AVIO_ prefixes for URL_ open flags. 2011-04-07 18:07:16 +02:00
Anton Khirnov 56a1000917 lavf: if id3v2 tag is present and all else fails, guess by file extension 2011-04-06 14:10:08 +02:00
Anton Khirnov 8978fedaee avio: introduce an AVIOContext.seekable field
Use it instead of url_is_streamed and AVIOContext.is_streamed.
2011-04-03 22:46:40 +02:00
Anton Khirnov ab11317c1f lavf: make compute_chapters_end less picky.
In particular, now it assumes that
a) chapters are chronologically ordered
b) chapters have the same timebases
c) duration of the stream is known
and asserts if any of these is not met.

Make it properly deal with harsher conditions.

fixes issue2320
2011-04-01 19:53:55 +02:00
Justin Ruggles c70a6a41dd Use audio_service_type to set stream disposition. 2011-03-25 16:58:50 -04:00
Anton Khirnov 933e90a69a avio: make av_url_read_fseek/fpause internal.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-21 14:54:52 -04:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Martin Storsjö f1f60f5252 lavf: Make make_absolute_url a lavf internal function
This is shared by both applehttp demuxer and protocol.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-03-17 12:28:37 +01:00
Stefano Sabatini 68d875addc lavf: make av_interleave_packet() return meaningful error codes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c5dcb3d493)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-03-17 07:30:09 +01:00
Stefano Sabatini 70abc32314 lavf: enable av_dlog message in av_interleaved_write_frame()
Help debugging timestamp issues.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d541c8b468)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-03-17 07:29:57 +01:00
Stefano Sabatini 79f43a8cb6 lavf: enable av_dlog() in compute_pkt_fields2()
Turns a comment into an av_dlog() instruction, also add a commented
issues.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 77f21ce464)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-03-17 07:29:47 +01:00
Anton Khirnov 59f65d9579 avio: make url_setbufsize internal.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-16 22:59:38 -04:00
Janne Grunau a03be6e1ba use LIBAV_LICENSE and LIBAV_VERSION instead of FFMPEG_* 2011-03-16 21:54:39 +01:00
Janne Grunau 29ba091136 replace FFMPEG with LIBAV in FFMPEG_CONFIGURATION
also update the multiple inclusion guards in config.h|mak
2011-03-16 21:54:39 +01:00
Nicolas George c76374c6db Use AVERROR_EXIT with url_interrupt_cb.
Functions interrupted by url_interrupt_cb should not be restarted.
Therefore using AVERROR(EINTR) was wrong, as it did not allow to distinguish
when the underlying system call was interrupted and actually needed to be
restarted.

This fixes roundup issues 2657 and 2659 (ffplay not exiting for streamed
content).

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-15 08:09:19 -04:00
Anton Khirnov 75b9ed04b9 lavf/utils: dont't explicitly check AVIOContext.error
The error should be caught in write_packet()/write_trailer()

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-15 08:04:10 -04:00
Anton Khirnov f1ef2cd9ed avio: move ff_rewind_with_probe_data from avio.h to avio_internal.h
also change its prefix to ffio

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-07 12:25:36 -05:00
Anton Khirnov 76aa876e69 avio: avio_ prefix for url_fsize
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-07 11:03:39 -05:00
Anton Khirnov a2704c9712 avio: add avio_tell macro as a replacement for url_ftell
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-04 11:26:57 -05:00
Martin Storsjö 863c471638 libavformat: Add av_pkt_dump{, _log}2, taking an AVStream parameter
This removes a fixme issue, by allowing the av_pkt_dump functions
to use the correct time base.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-03-02 11:29:38 +01:00
Anton Khirnov 6b4aa5dac8 avio: avio_ prefix for url_fseek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-01 12:12:33 -05:00
Anton Khirnov 22a3212e32 avio: rename url_fopen/fclose -> avio_open/close.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-23 10:18:55 -05:00
Anton Khirnov b7effd4e83 avio: avio_ prefixes for get_* functions
In the name of consistency:
get_byte           -> avio_r8
get_<type>         -> avio_r<type>
get_buffer         -> avio_read

get_partial_buffer will be made private later

get_strz is left out becase I want to change it later to return
something useful.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-21 11:23:22 -05:00
Anton Khirnov ae628ec1fd avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-20 08:37:15 -05:00
Anton Khirnov ab0287fcbd Move find_info_tag to lavu and add av_ prefix to it
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-17 15:35:18 +01:00
Stefano Sabatini f6c7375a17 Deprecate parse_date() in favor of av_parse_time().
The new av_parse_time() is created in libavutil/parseutils.h, all the
internal functions used by parse_date are moved to
libavutil/parseutils.c and made static.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-16 23:39:56 +00:00
Anton Khirnov 610219a598 lavf: add av_ prefix to dump_format()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-16 23:39:56 +00:00
Balint Marton 22ec6b738f Fix av_find_best_stream when using a program
The current implementation has a bug, it is returning the stream index
in the found program, and not the stream index in the list of all
streams. The attached patch fixes this issue.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-16 11:47:42 +00:00
Reinhard Tartler 737eb5976f Merge libavcore into libavutil
It is pretty hopeless that other considerable projects will adopt
libavutil alone in other projects. Projects that need small footprint
are better off with more specialized libraries such as gnulib or rather
just copy the necessary parts that they need. With this in mind, nobody
is helped by having libavutil and libavcore split. In order to ease
maintenance inside and around FFmpeg and to reduce confusion where to
put common code, avcore's functionality is merged (back) to avutil.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-02-15 16:18:21 +01:00
Anssi Hannula 24a83bd10a lavf: add AV_DISPOSITION_CLEAN_EFFECTS flag
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-14 23:16:32 +00:00
Anssi Hannula 3c33c0e263 lavf: print stream disposition in dump_stream_format
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-13 15:21:11 +01:00
Peter Ross 5209149157 make av_find_best_stream() ignore streams marked with AV_DISPOSITION_*_IMPAIRED
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-10 22:55:17 +01:00
Alexander Strange 37b00b47cb Frame-based multithreading framework using pthreads
See doc/multithreading.txt for details on use in codecs.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-09 09:17:28 -05:00
Anssi Hannula 3940caad02 lavf: rename ff_probe_input_buffer to make it public
It is useful for applications that hand input data directly to lavf via
a ByteIOContext.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-08 18:25:12 -05:00
Anssi Hannula aad216fd7e lavf: simplify pb parameter of ff_probe_input_buffer
There is no need to pass the ByteIOContext via a pointer to a pointer
anymore.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-08 18:25:11 -05:00
Reimar Döffinger b3190529df Make av_set_pts_info keep previous time base if new one is invalid.
Fixes issue 2475.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-06 16:12:15 -05:00
Martin Storsjö f124b087ee 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 <rsbultje@gmail.com>
2011-02-04 11:29:41 -05:00
Peter Ross e6fb5a4f78 add ff_index_search_timestamp and ff_add_index_entry
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-03 21:50:54 -05:00
Diego Elio Pettenò 101e1f6ff9 Make ff_interleave_compare_dts static to utils.c.
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-25 21:48:03 +01:00
Stefano Sabatini 440d761e40 Clarify timestamps related error messages in compute_pkt_fields2().
Originally committed as revision 26308 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-11 12:17:27 +00:00
Daniel Kang 6cbce63650 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://svn.ffmpeg.org/ffmpeg/trunk
2011-01-06 03:30:19 +00:00
Stefano Sabatini 6bbdba08c2 Revert previous commit, as it was not meant to be pushed.
Originally committed as revision 26239 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-06 01:11:57 +00:00
Stefano Sabatini 7820147e6f Issue more explicit error messages in compute_pkt_fields2().
Originally committed as revision 26238 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-06 01:01:21 +00:00
Stefano Sabatini 81bd411965 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
the file descriptor of an already closed file.

Originally committed as revision 26237 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-06 01:01:14 +00:00