aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-29 11:01:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-29 11:02:25 +0100
commit774a2684973ef66d80b77e657d3fe28e3f37c496 (patch)
treeb8356bb91fb03f8c09fc7f9767edaed84611768a
parent8ed9d34aa7f0002d46fa78bbda58a816edaf1169 (diff)
parente46a2a7309d8e8b8c1573047731dea77695d0ce1 (diff)
downloadffmpeg-774a2684973ef66d80b77e657d3fe28e3f37c496.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: flvdec: read audio sample size and channels metadata Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/flvdec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 0121e3db46..9329b483a4 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -398,7 +398,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))
@@ -420,6 +420,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;