From 4e96a71626996c5f128655c472e3b98558023f33 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 19 May 2023 09:57:24 +0200 Subject: [PATCH] fftools/ffmpeg_demux: log discontinuity warnings to stream context Allows simplifying the log message. --- fftools/ffmpeg_demux.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 828a1182f0..561b4b0002 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -248,12 +248,10 @@ static void ts_discontinuity_detect(Demuxer *d, InputStream *ist, if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE || pkt_dts + AV_TIME_BASE/10 < ds->dts) { d->ts_offset_discont -= delta; - av_log(NULL, AV_LOG_WARNING, - "timestamp discontinuity for stream #%d:%d " - "(id=%d, type=%s): %"PRId64", new offset= %"PRId64"\n", - ist->file_index, ist->st->index, ist->st->id, - av_get_media_type_string(ist->par->codec_type), - delta, d->ts_offset_discont); + av_log(ist, AV_LOG_WARNING, + "timestamp discontinuity " + "(stream id=%d): %"PRId64", new offset= %"PRId64"\n", + ist->st->id, delta, d->ts_offset_discont); pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, pkt->time_base); if (pkt->pts != AV_NOPTS_VALUE) pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, pkt->time_base);