From 68683d15c4583e76c431e0c36ee76e3621340c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 16 Sep 2021 12:53:12 +0300 Subject: [PATCH] splitmuxsink: Only count keyframes for the reference context, consistently Part-of: --- .../gst-plugins-good/gst/multifile/gstsplitmuxsink.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c index 0d4a6a3f79..4ecba84aa8 100644 --- a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c +++ b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c @@ -1754,7 +1754,7 @@ handle_mq_output (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx) } /* If we have popped a keyframe, decrement the queued_gop count */ - if (buf_info->keyframe && splitmux->queued_keyframes > 0) + if (buf_info->keyframe && splitmux->queued_keyframes > 0 && ctx->is_reference) splitmux->queued_keyframes--; ctx->out_running_time = buf_info->run_ts; @@ -2926,10 +2926,9 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx) } while (loop_again); - if (keyframe) { + if (keyframe && ctx->is_reference) splitmux->queued_keyframes++; - buf_info->keyframe = TRUE; - } + buf_info->keyframe = keyframe; /* Update total input byte counter for overflow detect */ splitmux->gop_total_bytes += buf_info->buf_size;