diff options
author | Gyan Doshi <ffmpeg@gyani.pro> | 2019-09-18 10:37:16 +0530 |
---|---|---|
committer | Gyan Doshi <ffmpeg@gyani.pro> | 2020-01-23 12:08:20 +0530 |
commit | 41f283ec7a2ee29c65b468c3d2c46d119dbb9071 (patch) | |
tree | d441a978dcf5dc95e26e27e2ba4ff0949c2bcef3 | |
parent | ec4f764249817a93787d76990dc4618d59e70f5d (diff) | |
download | ffmpeg-41f283ec7a2ee29c65b468c3d2c46d119dbb9071.tar.gz |
avformat/utils: log corrupt packets
-rw-r--r-- | libavformat/utils.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index f3d71642c3..e22ca7cab8 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -881,13 +881,16 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) return err; } - if ((s->flags & AVFMT_FLAG_DISCARD_CORRUPT) && - (pkt->flags & AV_PKT_FLAG_CORRUPT)) { + if (pkt->flags & AV_PKT_FLAG_CORRUPT) { av_log(s, AV_LOG_WARNING, - "Dropped corrupted packet (stream = %d)\n", - pkt->stream_index); - av_packet_unref(pkt); - continue; + "Packet corrupt (stream = %d, dts = %s)", + pkt->stream_index, av_ts2str(pkt->dts)); + if (s->flags & AVFMT_FLAG_DISCARD_CORRUPT) { + av_log(s, AV_LOG_WARNING, ", dropping it.\n"); + av_packet_unref(pkt); + continue; + } + av_log(s, AV_LOG_WARNING, ".\n"); } av_assert0(pkt->stream_index < (unsigned)s->nb_streams && |