1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avconv: do not stop processing the input packet on decoding error

We still want to flush the filters on EOF and possibly apply streamcopy.
This commit is contained in:
Anton Khirnov
2015-05-06 13:55:38 +02:00
parent b114f6d48a
commit 9a5e4fbec8

View File

@@ -1358,7 +1358,7 @@ static int send_filter_eof(InputStream *ist)
} }
/* pkt = NULL means EOF (needed to flush decoder buffers) */ /* pkt = NULL means EOF (needed to flush decoder buffers) */
static int process_input_packet(InputStream *ist, const AVPacket *pkt) static void process_input_packet(InputStream *ist, const AVPacket *pkt)
{ {
int i; int i;
int got_output; int got_output;
@@ -1415,11 +1415,17 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
ret = transcode_subtitles(ist, &avpkt, &got_output); ret = transcode_subtitles(ist, &avpkt, &got_output);
break; break;
default: default:
return -1; return;
}
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d\n",
ist->file_index, ist->st->index);
if (exit_on_error)
exit_program(1);
break;
} }
if (ret < 0)
return ret;
// touch data and size only if not EOF // touch data and size only if not EOF
if (pkt) { if (pkt) {
avpkt.data += ret; avpkt.data += ret;
@@ -1466,7 +1472,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
do_streamcopy(ist, ost, pkt); do_streamcopy(ist, ost, pkt);
} }
return 0; return;
} }
static void print_sdp(void) static void print_sdp(void)
@@ -2481,13 +2487,7 @@ static int process_input(void)
} }
} }
ret = process_input_packet(ist, &pkt); process_input_packet(ist, &pkt);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d\n",
ist->file_index, ist->st->index);
if (exit_on_error)
exit_program(1);
}
discard_packet: discard_packet:
av_free_packet(&pkt); av_free_packet(&pkt);