fftools/ffmpeg_dec: return error codes from dec_packet() instead of aborting

pull/389/head
Anton Khirnov 1 year ago
parent e0f4259689
commit 518b49a735
  1. 5
      fftools/ffmpeg.c
  2. 4
      fftools/ffmpeg_dec.c

@ -814,8 +814,11 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
int eof_reached = 0; int eof_reached = 0;
int duration_exceeded; int duration_exceeded;
if (ist->decoding_needed) if (ist->decoding_needed) {
ret = dec_packet(ist, pkt, no_eof); ret = dec_packet(ist, pkt, no_eof);
if (ret < 0 && ret != AVERROR_EOF)
return ret;
}
if (ret == AVERROR_EOF || (!pkt && !ist->decoding_needed)) if (ret == AVERROR_EOF || (!pkt && !ist->decoding_needed))
eof_reached = 1; eof_reached = 1;

@ -816,7 +816,7 @@ finish:
} }
// non-EOF errors here are all fatal // non-EOF errors here are all fatal
if (ret < 0 && ret != AVERROR_EOF) if (ret < 0 && ret != AVERROR_EOF)
report_and_exit(ret); return ret;
// signal EOF to our downstreams // signal EOF to our downstreams
if (ist->dec->type == AVMEDIA_TYPE_SUBTITLE) if (ist->dec->type == AVMEDIA_TYPE_SUBTITLE)
@ -825,7 +825,7 @@ finish:
ret = send_filter_eof(ist); ret = send_filter_eof(ist);
if (ret < 0) { if (ret < 0) {
av_log(NULL, AV_LOG_FATAL, "Error marking filters as finished\n"); av_log(NULL, AV_LOG_FATAL, "Error marking filters as finished\n");
exit_program(1); return ret;
} }
} }

Loading…
Cancel
Save