diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2013-03-21 08:23:51 -0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-03-31 10:38:22 +0200 |
commit | c6dce259670b210dce49d7cc6bffc2f5c967a6ad (patch) | |
tree | 6f0678eea4aabe1b9323e3c2b5400d9c111656a3 | |
parent | aba56c03b9558b80bd601bc58088a43c9b791ed1 (diff) | |
download | ffmpeg-c6dce259670b210dce49d7cc6bffc2f5c967a6ad.tar.gz |
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.
(cherry picked from commit e46a2a7309d8e8b8c1573047731dea77695d0ce1)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavformat/flvdec.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 2821dd8c34..2f68653882 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -400,7 +400,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst acodec = astream ? astream->codec : NULL; vcodec = vstream ? vstream->codec : NULL; - if (amf_type == AMF_DATA_TYPE_NUMBER) { + if (amf_type == AMF_DATA_TYPE_NUMBER || amf_type == AMF_DATA_TYPE_BOOL) { if (!strcmp(key, "duration")) s->duration = num_val * AV_TIME_BASE; else if (!strcmp(key, "videodatarate") && vcodec && 0 <= (int)(num_val * 1024.0)) @@ -422,6 +422,13 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst } else if (!strcmp(key, "audiosamplerate") && acodec) { acodec->sample_rate = num_val; + } else if (!strcmp(key, "audiosamplesize") && acodec) { + acodec->bits_per_coded_sample = num_val; + } else if (!strcmp(key, "stereo") && acodec) { + acodec->channels = num_val + 1; + acodec->channel_layout = acodec->channels == 2 ? + AV_CH_LAYOUT_STEREO : + AV_CH_LAYOUT_MONO; } else if (!strcmp(key, "width") && vcodec) { vcodec->width = num_val; |