Bug 1364870: [ffmpeg] only check format if frame has been decoded. r=gerald

The format member isn't set when an audio frame hasn't been decoded yet.

MozReview-Commit-ID: IgUj6bjVzdF

--HG--
extra : rebase_source : bb47fa523384f9a85ee7d0ed5b6de4fe2c73526a
This commit is contained in:
Jean-Yves Avenard 2017-05-19 09:52:12 +02:00
Родитель fb5df1656c
Коммит b35c566d48
1 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -153,6 +153,7 @@ FFmpegAudioDecoder<LIBAV_VER>::ProcessDecode(MediaRawData* aSample)
__func__);
}
if (decoded) {
if (mFrame->format != AV_SAMPLE_FMT_FLT &&
mFrame->format != AV_SAMPLE_FMT_FLTP &&
mFrame->format != AV_SAMPLE_FMT_S16 &&
@ -162,11 +163,10 @@ FFmpegAudioDecoder<LIBAV_VER>::ProcessDecode(MediaRawData* aSample)
return DecodePromise::CreateAndReject(
MediaResult(
NS_ERROR_DOM_MEDIA_DECODE_ERR,
RESULT_DETAIL("FFmpeg audio decoder outputs unsupported audio format")),
RESULT_DETAIL(
"FFmpeg audio decoder outputs unsupported audio format")),
__func__);
}
if (decoded) {
uint32_t numChannels = mCodecContext->channels;
AudioConfig::ChannelLayout layout(numChannels);
if (!layout.IsValid()) {