1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

idroqdec: set channel layout

This commit is contained in:
Justin Ruggles 2012-04-07 14:03:43 -04:00
parent f6c3adde41
commit 73e2007f3d

View File

@ -27,6 +27,7 @@
* http://www.csse.monash.edu.au/~timf/ * http://www.csse.monash.edu.au/~timf/
*/ */
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
#include "internal.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_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_ROQ_DPCM; st->codec->codec_id = AV_CODEC_ID_ROQ_DPCM;
st->codec->codec_tag = 0; /* no tag */ 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->sample_rate = RoQ_AUDIO_SAMPLE_RATE;
st->codec->bits_per_coded_sample = 16; st->codec->bits_per_coded_sample = 16;
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *