}
/* 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;
}
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;