This fixes stream lookup in flv demuxer. When used with librtmp
protocol streams are sometimes added after head arrived. If the
first stream added in flv header reader is Audio stream then it
is messed with Video stream added later in the code patched.
The result is I have 2 Audio streams (first of them is said to have
a video codec like h264) instead of Audio/Video pair.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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>
This fixes passing junk in stream.
It should not have any user vissible effect.
We are discarding the new data in the decoder as no case is known
where it is needed but it causes problems if used.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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>
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>
It had become dead code when code was added to avoid
exporting audio and video codec id as metadata.
Untested due to lack of sample.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
instead of when the 2nd stream has been found.
This isnt ideal as we will likely still like before miss a data stream.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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.