splitmuxsink: Only count keyframes for the reference context, consistently
authorSebastian Dröge <sebastian@centricular.com>
Thu, 16 Sep 2021 09:53:12 +0000 (12:53 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 5 Oct 2021 12:35:19 +0000 (12:35 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>

subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c

index 0d4a6a3..4ecba84 100644 (file)
@@ -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;