Commit Graph

167 Commits

Author SHA1 Message Date
Michael Niedermayer e60bdb7e5c flvdec: Remove the now redundant check for known broken metadata creator
The index validation identifies these indexes as broken.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-27 12:07:24 +02:00
Martin Storsjö 7e297a46db flvdec: Validate index entries added from metadata while reading
By validating the index entries while reading, we don't need to
seek at startup to validate the entries. If the error in the
index entries is not pointing to (our definition of) the start
of packets, and there is an index entry pointing at some of the
first packets after the metadata, the invalid index can be discarded
almost immediately.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-27 12:07:24 +02:00
Martin Storsjö b70f04c261 flvdec: Ignore the index if the ignidx flag is set
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-22 12:27:24 +02:00
Martin Storsjö 0a7ce3caa8 flvdec: Fix indentation
Also split a long line.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-22 12:27:15 +02:00
Anton Khirnov 9a463917d3 lavf: remove the pointless value field from flv and iv8
The demuxers don't use it in any way.
2012-01-31 07:48:03 +01:00
Martin Storsjö 89f6e8a20c flvdec: Interpret a toplevel 'object' type metadata item as normal metadata, too
Previously, we've only passed the key string on to the recursive
amf_parse_object for the mixedarray type, not for 'object'. By
passing the key string on, the recursive amf_parse_object can
store the amf objects as metadata.

This kind of data was seen in data from XSplit Broadcaster, received
over RTMP via Wowza. This patch allows reading this metadata.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-30 23:34:47 +02:00
Anton Khirnov 6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Jean First 2df73eefb4 flvdec: Fix compiler warning for uninitialized variables
These can't be used uninitialized in practice, but the
compiler doesn't realize it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-04 22:15:47 +02:00
Martin Storsjö 2215c39e94 flvdec: Add param change side data if the sample rate or channels have changed
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-21 22:52:41 +02:00
Martin Storsjö 251f320f7d flvdec: Export new AAC/H.264 extradata as side data on the next packet
Compared to just overwriting the old extradata, this has the
advantage of letting the decoder know exactly when the
extradata changed (otherwise it is changed immediately when the
new extradata packet is demuxed, even if there's old queued packets
awaiting to be decoded). This makes it easier for decoders to
actually react to the change, so they won't have to inspect
the extradata for each packet to see if it might have changed.

This works when sequentially playing a file with sample rate
changes, but if seeking past a new extradata packet in the
file, it obviously doesn't work properly. That case doesn't
work in flash player either, so it's probably ok not to handle
it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-21 22:52:38 +02:00
Mans Rullgard 3383a53e7d lavu: replace int/float punning functions
The existing functions defined in intfloat_readwrite.[ch] are
both slow and incorrect (infinities are not handled).

This introduces a new header with fast, inline conversion
functions using direct union punning assuming an IEEE-754
system, an assumption already made throughout the code.

The one use of Intel/Motorola extended 80-bit format is
replaced by simpler code sufficient under the present
constraints (positive normal values).

The old functions are marked deprecated and retained for
compatibility.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-11 18:47:19 +00:00
Janne Grunau fd095539d1 latmdec: fix audio specific config parsing
Pass the correct size in bits to mpeg4audio_get_config and add a flag
to disable parsing of the sync extension when the size is not known.

Latm with AudioMuxVersion 0 does not specify the size of the audio
specific config. Data after the audio specific config can be
misinterpreted as sync extension resulting in random and wrong configs.
2011-12-03 00:42:48 +01:00
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
Reimar Döffinger f4b51d061f flvdec: Do not call parse_keyframes_index with a NULL stream
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-22 00:59:33 +03:00
Anton Khirnov 59a9a23581 lavc: use avpriv_ prefix for some mpeg4audio symbols used in lavf.
Specifically, ff_mpeg4audio_sample_rates, ff_mpeg4audio_get_config and
ff_copy_pce_data
2011-10-20 21:06:57 +02:00
Anton Khirnov 84ad31ff18 lavf: replace av_new_stream->avformat_new_stream part II.
Manual replacements are done in this commit.

In many cases, the id is some constant made up number (e.g. 0 for video
and 1 for audio), which is then not used in the demuxer for anything.
Those ids are removed.
2011-10-19 17:02:11 +02:00
Martin Storsjö 5e87222fd1 flvdec: Don't export metadata entries that aren't proper metadata
This avoids writing these entries doubly if transcoding from
flv to flv, since the muxer blindly writes any and all metadata
keys set, in addition to the fixed fields that the muxer
always writes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-12 10:19:47 +03:00
Martin Storsjö b204c46d9d flvdec: Split out setting of numeric fields from storing metadata
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-12 10:19:38 +03:00
Michael Niedermayer a246cefa75 flvdec: Check for overflow before allocating arrays
On allocation, the array length is multiplied by sizeof(int64_t),
this prevents the multiplication from overflowing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-25 12:55:21 +03:00
Laurent Aimar 2b4e49d428 flvdec: Fix invalid pointer deferences when parsing index
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-24 18:08:39 +03:00
Martin Storsjö bafff1668c flvdec: Ignore the index if it's from a creator known to be different
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-23 20:59:48 +03:00
Anton Khirnov dfc2c4d900 lavf: use designated initialisers for all (de)muxers.
It's more readable and less prone to breakage.
2011-07-17 06:58:37 +02:00
Diego Biurrun d3f751e603 Add some missing mathematics.h #includes for av_rescale(). 2011-07-05 20:16:38 +02:00
Mans Rullgard ee8aecd23a Do not include intfloat_readwrite.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Anton Khirnov d2d67e424f Remove all uses of now deprecated metadata functions. 2011-06-08 07:43:45 +02:00
Alex Converse 13220b1856 flvdec: clenup debug code 2011-05-17 22:08:11 +02:00
Martin Storsjö 578d6861a7 flvdec: Allow parsing keyframes metadata without seeking in most cases
Stop the avio input at a point where amf_parse_object can
continue parsing the end of the object seamlessly, when all
data is available.

If unsupported data is encountered within the keyframes object,
try seeking to the start of the keyframes object - if the seek
back was successful, the caller can continue parsing the rest
of the AMF data.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-12 23:08:55 +03: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
Kharkov Alexander b5304f7b2e flvdec: Fix support for flvtool2 "keyframes based" generated index
Current keyframes data parser unconditionally rewind metadata to
the end at the end of function. As result ALL metadata located
after keyframes index not parsed, and as metadata object can have
ANY placement inside metadata it can lead to unpredictable result
(bitrate can not be found, etc.). As result FLV movie will not
play at all in such situation.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-12 12:38:45 +03:00
Justin Ruggles e3c007bb43 flvdec: fix segfault in amf_parse_object() due to NULL key
fixes Issue 2674
2011-04-03 20:29:04 -04: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
Kharkov Alexander cb7e2c1ca8 flvdec: read index stored in the 'keyframes' tag.
'keyframes' metatag is not part of the standard, it is just
convention to use such kind of metatag information for indexing.
Structure is following, it allows to have it inconsistent:
keyframes:
 times (array):
  time0 (num)
  time1 (num)
  time2 (num)
 filepositions (array)
  position0 (num)
  position1 (num)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-03-31 07:31:58 +02: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
Anton Khirnov 45a8a02a41 lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes sense
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-16 22:24:51 -04:00
Anton Khirnov 66e5b1df36 avio: deprecate url_feof
AVIOContext.eof_reached should be used directly instead.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-07 17:20:31 -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
Anton Khirnov e356fc57a2 lavf: replace all uses of url_fskip with avio_seek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-01 12:22:16 -05: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 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
Luca Barbato dfd2a005eb Replace dprintf with av_dlog
dprintf clashes with POSIX.1-2008
2011-01-29 23:55:37 +01:00
Diego Elio Pettenò c6610a216e Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.
2011-01-26 22:10:09 +00:00
Thierry Foucu caa7ad5dc6 Fix 16kHz Mono NellyMoser in flv.
Patch by Thierry Foucu, tfoucu gmail

Originally committed as revision 25667 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-03 20:12:07 +00:00
Baptiste Coudurier 7d6096e42e Use ext sample from mpeg4audio config if set with AAC SBR
Originally committed as revision 23947 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-01 22:31:31 +00:00
Stefano Sabatini 2ef6c1242a 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://svn.ffmpeg.org/ffmpeg/trunk
2010-04-25 14:27:42 +00:00
Howard Chu fc8fa007fb Implement librtmp seek support.
Implement flv_read_seek(), add a missing check on stream_index
and fix timestamp rounding in rtmp_read_seek().

Also add the flv_read_seek2() function, which is not enabled but is
useful as reference.
To actually implement flv_read_seek2() correctly, there would need to
be some corresponding av_url_read_fseek2() function to propagate the
timestamps down to the ByteIOContext and URLContext.

Patch by Howard Chu <hyc <at> highlandsun.com>.

See the thread:
Subject: [FFmpeg-devel] RTMP seek support
Date: 2010-03-28 23:35:02 GMT

Originally committed as revision 22904 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-18 19:09:25 +00:00
Howard Chu 7e939205d9 Set audio bit rate.
Patch by Howard Chu, hyc highlandsun com

Originally committed as revision 22835 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-11 12:21:30 +00:00
Howard Chu 527c2e6429 Fix flvdec start-of-frame.
Patch by Howard Chu hyc highlandsun com

Originally committed as revision 22757 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-01 08:02:20 +00:00