[FFmpeg-devel] [PATCH 2/2] avformat/demux: Combine "Packet corrupt" logmessages
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Thu Mar 21 14:34:42 EET 2024
Otherwise these statements might be torn apart by
av_logs from other threads.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavformat/demux.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libavformat/demux.c b/libavformat/demux.c
index 4345ed4c8c..e50d1a9cfe 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -572,14 +572,13 @@ static int handle_new_packet(AVFormatContext *s, AVPacket *pkt, int allow_passth
if (pkt->flags & AV_PKT_FLAG_CORRUPT) {
av_log(s, AV_LOG_WARNING,
- "Packet corrupt (stream = %d, dts = %s)",
- pkt->stream_index, av_ts2str(pkt->dts));
+ "Packet corrupt (stream = %d, dts = %s)%s.\n",
+ pkt->stream_index, av_ts2str(pkt->dts),
+ s->flags & AVFMT_FLAG_DISCARD_CORRUPT ? ", dropping it" : "");
if (s->flags & AVFMT_FLAG_DISCARD_CORRUPT) {
- av_log(s, AV_LOG_WARNING, ", dropping it.\n");
av_packet_unref(pkt);
return 1;
}
- av_log(s, AV_LOG_WARNING, ".\n");
}
st = s->streams[pkt->stream_index];
--
2.40.1
More information about the ffmpeg-devel
mailing list