diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp')
-rw-r--r-- | dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp index 30422987cf..e86ff63dba 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp @@ -231,11 +231,22 @@ FFmpegDataDecoder<LIBAV_VER>::ProcessDrain() { empty->mTimecode = mLastInputDts; bool gotFrame = false; DecodedData results; - // When draining the FFmpeg decoder will return either a single frame at a - // time until gotFrame is set to false; or return a block of frames with - // NS_ERROR_DOM_MEDIA_END_OF_STREAM - while (NS_SUCCEEDED(DoDecode(empty, &gotFrame, results)) && gotFrame) { - } + // When draining the underlying FFmpeg decoder without encountering any + // problems, DoDecode will either return a single frame at a time until + // gotFrame is set to false, or it will return a block of frames with + // NS_ERROR_DOM_MEDIA_END_OF_STREAM (EOS). However, if any issue arises, such + // as pending data in the pipeline being corrupt or invalid, non-EOS errors + // like NS_ERROR_DOM_MEDIA_DECODE_ERR will be returned and must be handled + // accordingly. + do { + MediaResult r = DoDecode(empty, &gotFrame, results); + if (NS_FAILED(r)) { + if (r.Code() == NS_ERROR_DOM_MEDIA_END_OF_STREAM) { + break; + } + return DecodePromise::CreateAndReject(r, __func__); + } + } while (gotFrame); return DecodePromise::CreateAndResolve(std::move(results), __func__); } |