зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
fb5df1656c
Коммит
b35c566d48
|
@ -153,20 +153,20 @@ FFmpegAudioDecoder<LIBAV_VER>::ProcessDecode(MediaRawData* aSample)
|
||||||
__func__);
|
__func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mFrame->format != AV_SAMPLE_FMT_FLT &&
|
|
||||||
mFrame->format != AV_SAMPLE_FMT_FLTP &&
|
|
||||||
mFrame->format != AV_SAMPLE_FMT_S16 &&
|
|
||||||
mFrame->format != AV_SAMPLE_FMT_S16P &&
|
|
||||||
mFrame->format != AV_SAMPLE_FMT_S32 &&
|
|
||||||
mFrame->format != AV_SAMPLE_FMT_S32P) {
|
|
||||||
return DecodePromise::CreateAndReject(
|
|
||||||
MediaResult(
|
|
||||||
NS_ERROR_DOM_MEDIA_DECODE_ERR,
|
|
||||||
RESULT_DETAIL("FFmpeg audio decoder outputs unsupported audio format")),
|
|
||||||
__func__);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (decoded) {
|
if (decoded) {
|
||||||
|
if (mFrame->format != AV_SAMPLE_FMT_FLT &&
|
||||||
|
mFrame->format != AV_SAMPLE_FMT_FLTP &&
|
||||||
|
mFrame->format != AV_SAMPLE_FMT_S16 &&
|
||||||
|
mFrame->format != AV_SAMPLE_FMT_S16P &&
|
||||||
|
mFrame->format != AV_SAMPLE_FMT_S32 &&
|
||||||
|
mFrame->format != AV_SAMPLE_FMT_S32P) {
|
||||||
|
return DecodePromise::CreateAndReject(
|
||||||
|
MediaResult(
|
||||||
|
NS_ERROR_DOM_MEDIA_DECODE_ERR,
|
||||||
|
RESULT_DETAIL(
|
||||||
|
"FFmpeg audio decoder outputs unsupported audio format")),
|
||||||
|
__func__);
|
||||||
|
}
|
||||||
uint32_t numChannels = mCodecContext->channels;
|
uint32_t numChannels = mCodecContext->channels;
|
||||||
AudioConfig::ChannelLayout layout(numChannels);
|
AudioConfig::ChannelLayout layout(numChannels);
|
||||||
if (!layout.IsValid()) {
|
if (!layout.IsValid()) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче