mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 09:45:32 +00:00
Use av_get_default_channel_layout for unknown channel layouts
This commit is contained in:
parent
efa4d09c48
commit
17cb181f88
2 changed files with 2 additions and 26 deletions
|
@ -307,19 +307,7 @@ void FFmpeg_Decoder::getInfo(int *samplerate, ChannelConfig *chans, SampleType *
|
||||||
int64_t ch_layout = (*mStream)->codec->channel_layout;
|
int64_t ch_layout = (*mStream)->codec->channel_layout;
|
||||||
|
|
||||||
if(ch_layout == 0)
|
if(ch_layout == 0)
|
||||||
{
|
ch_layout = av_get_default_channel_layout((*mStream)->codec->channels);
|
||||||
/* Unknown channel layout. Try to guess. */
|
|
||||||
if((*mStream)->codec->channels == 1)
|
|
||||||
ch_layout = AV_CH_LAYOUT_MONO;
|
|
||||||
else if((*mStream)->codec->channels == 2)
|
|
||||||
ch_layout = AV_CH_LAYOUT_STEREO;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::stringstream sstr("Unsupported raw channel count: ");
|
|
||||||
sstr << (*mStream)->codec->channels;
|
|
||||||
fail(sstr.str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mOutputChannelLayout = ch_layout;
|
mOutputChannelLayout = ch_layout;
|
||||||
if (ch_layout == AV_CH_LAYOUT_5POINT1 || ch_layout == AV_CH_LAYOUT_7POINT1
|
if (ch_layout == AV_CH_LAYOUT_5POINT1 || ch_layout == AV_CH_LAYOUT_7POINT1
|
||||||
|
|
14
extern/ogre-ffmpeg-videoplayer/audiodecoder.cpp
vendored
14
extern/ogre-ffmpeg-videoplayer/audiodecoder.cpp
vendored
|
@ -94,19 +94,7 @@ void MovieAudioDecoder::setupFormat()
|
||||||
|
|
||||||
uint64_t inputChannelLayout = mAVStream->codec->channel_layout;
|
uint64_t inputChannelLayout = mAVStream->codec->channel_layout;
|
||||||
if (inputChannelLayout == 0)
|
if (inputChannelLayout == 0)
|
||||||
{
|
inputChannelLayout = av_get_default_channel_layout(mAVStream->codec->channels);
|
||||||
/* Unknown channel layout. Try to guess. */
|
|
||||||
if(mAVStream->codec->channels == 1)
|
|
||||||
inputChannelLayout = AV_CH_LAYOUT_MONO;
|
|
||||||
else if(mAVStream->codec->channels == 2)
|
|
||||||
inputChannelLayout = AV_CH_LAYOUT_STEREO;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::stringstream sstr("Unsupported raw channel count: ");
|
|
||||||
sstr << mAVStream->codec->channels;
|
|
||||||
fail(sstr.str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int inputSampleRate = mAVStream->codec->sample_rate;
|
int inputSampleRate = mAVStream->codec->sample_rate;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue