ffmpeg: exit_on_error if decoding a packet failed
This is the second part of the fix for ticket #4370. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commitcd64ead8d9
) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Conflicts: ffmpeg.c (cherry picked from commit1d1adf5ff4
) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:

committed by
Michael Niedermayer

parent
a0f50ddcb8
commit
32df1cd6ac
9
ffmpeg.c
9
ffmpeg.c
@@ -1844,6 +1844,9 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
if (*got_output || ret<0 || pkt->size)
|
if (*got_output || ret<0 || pkt->size)
|
||||||
decode_error_stat[ret<0] ++;
|
decode_error_stat[ret<0] ++;
|
||||||
|
|
||||||
|
if (ret < 0 && exit_on_error)
|
||||||
|
exit_program(1);
|
||||||
|
|
||||||
if (!*got_output || ret < 0) {
|
if (!*got_output || ret < 0) {
|
||||||
if (!pkt->size) {
|
if (!pkt->size) {
|
||||||
for (i = 0; i < ist->nb_filters; i++)
|
for (i = 0; i < ist->nb_filters; i++)
|
||||||
@@ -1989,6 +1992,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
if (*got_output || ret<0 || pkt->size)
|
if (*got_output || ret<0 || pkt->size)
|
||||||
decode_error_stat[ret<0] ++;
|
decode_error_stat[ret<0] ++;
|
||||||
|
|
||||||
|
if (ret < 0 && exit_on_error)
|
||||||
|
exit_program(1);
|
||||||
|
|
||||||
if (*got_output && ret >= 0) {
|
if (*got_output && ret >= 0) {
|
||||||
if (ist->dec_ctx->width != decoded_frame->width ||
|
if (ist->dec_ctx->width != decoded_frame->width ||
|
||||||
ist->dec_ctx->height != decoded_frame->height ||
|
ist->dec_ctx->height != decoded_frame->height ||
|
||||||
@@ -2107,6 +2113,9 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
if (*got_output || ret<0 || pkt->size)
|
if (*got_output || ret<0 || pkt->size)
|
||||||
decode_error_stat[ret<0] ++;
|
decode_error_stat[ret<0] ++;
|
||||||
|
|
||||||
|
if (ret < 0 && exit_on_error)
|
||||||
|
exit_program(1);
|
||||||
|
|
||||||
if (ret < 0 || !*got_output) {
|
if (ret < 0 || !*got_output) {
|
||||||
if (!pkt->size)
|
if (!pkt->size)
|
||||||
sub2video_flush(ist);
|
sub2video_flush(ist);
|
||||||
|
Reference in New Issue
Block a user