Skip to content

Commit

Permalink
avconv: do not stop processing the input packet on decoding error
Browse files Browse the repository at this point in the history
We still want to flush the filters on EOF and possibly apply streamcopy.
  • Loading branch information
elenril committed Jun 27, 2015
1 parent b114f6d commit 9a5e4fb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions avconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ static int send_filter_eof(InputStream *ist)
}

/* 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 got_output;
Expand Down Expand Up @@ -1415,11 +1415,17 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
ret = transcode_subtitles(ist, &avpkt, &got_output);
break;
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
if (pkt) {
avpkt.data += ret;
Expand Down Expand Up @@ -1466,7 +1472,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
do_streamcopy(ist, ost, pkt);
}

return 0;
return;
}

static void print_sdp(void)
Expand Down Expand Up @@ -2481,13 +2487,7 @@ static int process_input(void)
}
}

ret = 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);
}
process_input_packet(ist, &pkt);

discard_packet:
av_free_packet(&pkt);
Expand Down

0 comments on commit 9a5e4fb

Please sign in to comment.