Commit Graph

202 Commits

Author SHA1 Message Date
Vittorio Giovara 629b2ed0ac flvdec: make sure to check create_stream and report the same error
CC: libav-stable@libav.org
Bug-Id: CID 732242
2014-10-21 14:37:48 +01:00
Vittorio Giovara f22aa6b841 flvdec: avoid unitialized use of a struct member
CC: libav-stable@libav.org
Bug-Id: CID 718141
2014-10-21 14:37:48 +01:00
Andrew Stone 0f789322ef flvdec: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:23:28 +00:00
Andrew Stone 93c04e095d Expose metadata found in onCuePoint events in .flv files.
Currently, only onMetaData is used, but some providers (wrongly)
put metadata into onCuePoint events, and it's still nice to be
able to use that data.

onCuePoint events also present metadata slightly differently than
onMetaData events: all metadata is found inside an object called
"parameters". In order to extract this metadata, it's easiest to
recurse through the object tree and pull out anything found in
child objects and put it in the top-level metadata.

Reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/2/help.html?content=00001404.html

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:11:43 +00:00
Luca Barbato fa14804c83 flv: Index the audio stream
And leverage the video index if the video is just disabled as wm4
did in an initial patch.
2014-08-01 15:04:51 +02:00
Uwe L. Korn a1859032e3 flvdec: Do not default to a video and audio stream
If no streams were indicated in the FLV header, do not automatically
allocate by default a video and an audio stream. Instead, in the case
that the header did not indicate the presence of any data, allocate no
stream until data actually arrives for one type.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-06-01 23:29:40 +03:00
Luca Barbato 152b797cd6 flv: Do not mangle dts values for negative cts
Some applications really mean to send negative pts.
2014-04-23 21:20:17 +02:00
Luca Barbato 5d983fdbca flv: Warn only once
No point in sending the message multiple time.
2014-04-23 21:19:27 +02:00
Luca Barbato 374fdc8c07 flv: Improve log messages
Messages should start with a capital letter and possibly end with a "."
if they are statements.
2014-04-23 21:04:20 +02:00
Benjamin Larsson 547f834537 flv: Workaround for buggy Omnia A/XE encoder
The Omnia A/XE encoder writes the explicit extra data incorrectly
and wrongly disables parametric stereo. Truncating the extra data
by setting the size to 2 works around this. The AAC extra data
parser will then only parse the correct parts.

Bug-id: 599
2014-01-11 13:14:20 +01:00
Luca Barbato c951e4b442 flv: Make onTextData parsing robust
Certain streaming servers do not preserve the order of the fields.
2013-09-22 01:10:17 +02:00
Luca Barbato 0a9425d7cf flv: Do not export datastream as metadata
It is used internally.
2013-09-16 19:36:37 +02:00
Luca Barbato f4634ae8a8 flv: Fix the help string 2013-08-27 14:38:54 +02:00
Diego Biurrun f900f35ac8 flvdec: Eliminate completely silly goto 2013-08-01 12:43:54 +02:00
Diego Biurrun e4529df944 flvdec: K&R formatting cosmetics 2013-08-01 12:43:53 +02:00
Diego Biurrun 390b4d7088 flvdec: Fix = vs. == typo in sample rate check 2013-08-01 12:43:53 +02:00
Diego Biurrun 6ff15cd569 Remove unreachable returns 2013-07-27 16:00:41 +02:00
Justin Ruggles e46a2a7309 flvdec: read audio sample size and channels metadata
This is needed in order for the FLV demuxer not to detect a codec change when
using the "flv_metadata" option.
2013-03-28 06:27:28 -04:00
Justin Ruggles c3d0157753 flvdec: use the correct audio codec id when parsing metadata 2013-03-28 06:27:28 -04:00
Martin Storsjö c5a738ca4e flvdec: Check the return value of a malloc
The callers of this function can't report errors sanely. If this
one malloc fails, don't write the extradata byte, make sure we
try to malloc it the next time we're called instead, and make sure
we still consume the input data byte.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-02 00:39:37 +02:00
Martin Storsjö c91c63b538 flvdec: Don't read the VP6 header byte when setting codec type based on metadata
This header byte is only present when actually reading a VP6 frame,
not when reading the codec type field in the metadata. This
potential bug has been present since 5b54a90c.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-02 00:39:36 +02:00
Justin Ruggles 644d8d2e5a flvdec: set channel layout 2012-11-12 10:33:19 -05:00
Anton Khirnov ee0dadc109 flvdec: always set AVFMTCTX_NOHEADER.
New streams may be created at any time, e.g. on codec change.
2012-09-11 09:13:29 +02:00
Martin Storsjö e6153f173a avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:44 +03:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Diego Biurrun 0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Luca Barbato 41f43202cf flvdec: remove spurious use of stream id
We match streams by codec id now.
2012-07-29 17:18:03 +02:00
Martin Storsjö e43f56b205 flvdec: Treat all nellymoser versions as the same codec
This avoids creating new AVStreams for them when switching between
different variants of them, since we can handle changes between
different sample rates of nellymoser within the same stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-05 22:07:45 +03:00
Luca Barbato 5b54a90c8b flvdec: optionally trust the metadata
In certain conditions video or audio frames might appear way later in the
stream.
2012-07-05 10:37:34 +02:00
Luca Barbato 09a445ce34 flvdec: initial stream switch support
Codec change midstream gets mapped to a separate stream.
2012-07-03 15:35:51 +02:00
Damien Fetis b92c7ee662 flv: add support for G.711
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-06-28 16:53:09 +02:00
Ronald S. Bultje 8703f0140f flvdec: remove incomplete, disabled seeking code 2012-06-19 01:02:10 +01:00
Luca Barbato 21e2dc9fb7 flv: support stream text data as onTextData
Adobe specifies onTextData as the standard message to use to deliver
text information.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-06-03 03:36:01 +02:00
Martin Storsjö 1e8561e369 flvdec: Make sure sample_rate is set to the updated value
The sample_rate variable is used for checks for audio format
changes at the end of the function.

This fixes cases where the sample rate was set from the codec
id by flv_set_audio_codec (as for nellymoser 8 kHz/16 kHz),
so the value set to last_sample_rate wasn't equal to sample_rate
at this point. This caused the demuxer otherwise reports a spurious
change to 5512 Hz and back to the correct one.

Updating channels in the same way is only done for consistency.
Currently, flv_set_audio_codec doesn't update that value.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-23 22:23:43 +03:00
Martin Storsjö 20234a4bd7 cosmetics: Align muxer/demuxer declarations
Also add missing trailing commas, break long codec_tag lines and
add spaces in codec_tag declarations.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 19:19:59 +03:00
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