1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

fftools/ffmpeg: move handling corrupt packets to the input thread

This commit is contained in:
Anton Khirnov 2022-03-22 18:17:27 +01:00
parent 61d9f34c70
commit a5e025e826
2 changed files with 11 additions and 7 deletions

View File

@ -3729,13 +3729,6 @@ static int process_input(int file_index)
if (ist->discard)
goto discard_packet;
if (pkt->flags & AV_PKT_FLAG_CORRUPT) {
av_log(NULL, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING,
"%s: corrupt input packet in stream %d\n", is->url, pkt->stream_index);
if (exit_on_error)
exit_program(1);
}
if (debug_ts) {
av_log(NULL, AV_LOG_INFO, "demuxer -> ist_index:%d type:%s "
"next_dts:%s next_dts_time:%s next_pts:%s next_pts_time:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n",

View File

@ -165,6 +165,17 @@ static void *input_thread(void *arg)
continue;
}
if (pkt->flags & AV_PKT_FLAG_CORRUPT) {
av_log(NULL, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING,
"%s: corrupt input packet in stream %d\n",
f->ctx->url, pkt->stream_index);
if (exit_on_error) {
av_packet_unref(pkt);
ret = AVERROR_INVALIDDATA;
break;
}
}
msg.pkt = av_packet_alloc();
if (!msg.pkt) {
av_packet_unref(pkt);