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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>