From 2e53a6424d2597204439457947ebb7242702df41 Mon Sep 17 00:00:00 2001 From: mangshe0 Date: Wed, 26 Aug 2020 17:08:51 +0800 Subject: [PATCH] fix Application provided invalid, non monotonically increasing dts to muxer in stream bug --- src/mod/applications/mod_av/avformat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index b76fd599bc..4faf4be99b 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -1972,6 +1972,8 @@ GCC_DIAG_ON(deprecated-declarations) if (!context->audio_timer) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Delta of %d detected. Video timer sync: %" SWITCH_UINT64_T_FMT "/%d %" SWITCH_UINT64_T_FMT "\n", delta, context->audio_st[0].next_pts, context->video_timer.samplecount, new_pts - context->audio_st[0].next_pts); } + if (new_pts - context->audio_st[0].next_pts <0 && context->audio_st[0].next_pts != 0) + return status; sample_start = new_pts; }