diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-04-07 14:03:43 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-12 10:33:19 -0500 |
commit | 73e2007f3d435dec6a5ddb6a47e706cc419eb7cd (patch) | |
tree | e5a062a455e6c7dc84e8f84d2501cfc0f9d3b556 /libavformat | |
parent | f6c3adde41921082964055193efbcf58195bf457 (diff) | |
download | ffmpeg-73e2007f3d435dec6a5ddb6a47e706cc419eb7cd.tar.gz |
idroqdec: set channel layout
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/idroqdec.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c index 521f586d90..eeaafec5aa 100644 --- a/libavformat/idroqdec.c +++ b/libavformat/idroqdec.c @@ -27,6 +27,7 @@ * http://www.csse.monash.edu.au/~timf/ */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -175,7 +176,14 @@ static int roq_read_packet(AVFormatContext *s, st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_ROQ_DPCM; st->codec->codec_tag = 0; /* no tag */ - st->codec->channels = roq->audio_channels = chunk_type == RoQ_SOUND_STEREO ? 2 : 1; + if (chunk_type == RoQ_SOUND_STEREO) { + st->codec->channels = 2; + st->codec->channel_layout = AV_CH_LAYOUT_STEREO; + } else { + st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; + } + roq->audio_channels = st->codec->channels; st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE; st->codec->bits_per_coded_sample = 16; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |