av{aud,vid}dec: Report decoding errors to the base class
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1889>
This commit is contained in:
parent
94ba019397
commit
925715c734
@ -545,14 +545,15 @@ gst_ffmpegauddec_audio_frame (GstFFMpegAudDec * ffmpegdec,
|
|||||||
if (ffmpegdec->frame->flags & AV_FRAME_FLAG_CORRUPT)
|
if (ffmpegdec->frame->flags & AV_FRAME_FLAG_CORRUPT)
|
||||||
GST_BUFFER_FLAG_SET (*outbuf, GST_BUFFER_FLAG_CORRUPTED);
|
GST_BUFFER_FLAG_SET (*outbuf, GST_BUFFER_FLAG_CORRUPTED);
|
||||||
} else if (res == AVERROR (EAGAIN)) {
|
} else if (res == AVERROR (EAGAIN)) {
|
||||||
|
GST_DEBUG_OBJECT (ffmpegdec, "Need more data");
|
||||||
*outbuf = NULL;
|
*outbuf = NULL;
|
||||||
*need_more_data = TRUE;
|
*need_more_data = TRUE;
|
||||||
} else if (res == AVERROR_EOF) {
|
} else if (res == AVERROR_EOF) {
|
||||||
*ret = GST_FLOW_EOS;
|
*ret = GST_FLOW_EOS;
|
||||||
GST_DEBUG_OBJECT (ffmpegdec, "Context was entirely flushed");
|
GST_DEBUG_OBJECT (ffmpegdec, "Context was entirely flushed");
|
||||||
} else if (res < 0) {
|
} else if (res < 0) {
|
||||||
*ret = GST_FLOW_OK;
|
GST_AUDIO_DECODER_ERROR (ffmpegdec, 1, STREAM, DECODE, (NULL),
|
||||||
GST_WARNING_OBJECT (ffmpegdec, "Legitimate decoding error");
|
("Audio decoding error"), *ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
beach:
|
beach:
|
||||||
@ -834,12 +835,16 @@ not_negotiated:
|
|||||||
|
|
||||||
send_packet_failed:
|
send_packet_failed:
|
||||||
{
|
{
|
||||||
GST_WARNING_OBJECT (ffmpegdec, "decoding error");
|
GST_AUDIO_DECODER_ERROR (ffmpegdec, 1, STREAM, DECODE, (NULL),
|
||||||
/* Even if ffmpeg was not able to decode current audio frame,
|
("Audio decoding error"), ret);
|
||||||
* we should call gst_audio_decoder_finish_frame() so that baseclass
|
|
||||||
* can clear its internal status and can respect timestamp of later
|
if (ret == GST_FLOW_OK) {
|
||||||
* incoming buffers */
|
/* Even if ffmpeg was not able to decode current audio frame,
|
||||||
ret = gst_ffmpegauddec_drain (ffmpegdec, TRUE);
|
* we should call gst_audio_decoder_finish_frame() so that baseclass
|
||||||
|
* can clear its internal status and can respect timestamp of later
|
||||||
|
* incoming buffers */
|
||||||
|
ret = gst_ffmpegauddec_drain (ffmpegdec, TRUE);
|
||||||
|
}
|
||||||
goto unmap;
|
goto unmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1778,15 +1778,16 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec,
|
|||||||
res = avcodec_receive_frame (ffmpegdec->context, ffmpegdec->picture);
|
res = avcodec_receive_frame (ffmpegdec->context, ffmpegdec->picture);
|
||||||
|
|
||||||
/* No frames available at this time */
|
/* No frames available at this time */
|
||||||
if (res == AVERROR (EAGAIN))
|
if (res == AVERROR (EAGAIN)) {
|
||||||
|
GST_DEBUG_OBJECT (ffmpegdec, "Need more data");
|
||||||
goto beach;
|
goto beach;
|
||||||
else if (res == AVERROR_EOF) {
|
} else if (res == AVERROR_EOF) {
|
||||||
*ret = GST_FLOW_EOS;
|
*ret = GST_FLOW_EOS;
|
||||||
GST_DEBUG_OBJECT (ffmpegdec, "Context was entirely flushed");
|
GST_DEBUG_OBJECT (ffmpegdec, "Context was entirely flushed");
|
||||||
goto beach;
|
goto beach;
|
||||||
} else if (res < 0) {
|
} else if (res < 0) {
|
||||||
*ret = GST_FLOW_OK;
|
GST_VIDEO_DECODER_ERROR (ffmpegdec, 1, STREAM, DECODE, (NULL),
|
||||||
GST_WARNING_OBJECT (ffmpegdec, "Legitimate decoding error");
|
("Video decoding error"), *ret);
|
||||||
goto beach;
|
goto beach;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user