From c5fa4666b7a827f34b734312b918b91a031dca38 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 6 Aug 2013 11:58:38 +0200 Subject: [PATCH] videomixer: Make sure to send EOS if the buffer end time equals the segment end time Otherwize EOS never gets sent in that particular case. --- gst/videomixer/videomixer2.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gst/videomixer/videomixer2.c b/gst/videomixer/videomixer2.c index 63f4204f73..27c4c06ac5 100644 --- a/gst/videomixer/videomixer2.c +++ b/gst/videomixer/videomixer2.c @@ -1004,7 +1004,13 @@ gst_videomixer2_collected (GstCollectPads * pads, GstVideoMixer2 * mix) else output_start_time = mix->segment.position; - if (output_start_time >= mix->segment.stop) { + output_end_time = + mix->ts_offset + gst_util_uint64_scale_round (mix->nframes + 1, + GST_SECOND * GST_VIDEO_INFO_FPS_D (&mix->info), + GST_VIDEO_INFO_FPS_N (&mix->info)) + mix->segment.start; + + if (output_start_time >= mix->segment.stop || + output_end_time == mix->segment.stop) { GST_DEBUG_OBJECT (mix, "Segment done"); GST_VIDEO_MIXER2_UNLOCK (mix); gst_pad_push_event (mix->srcpad, gst_event_new_eos ()); @@ -1012,10 +1018,6 @@ gst_videomixer2_collected (GstCollectPads * pads, GstVideoMixer2 * mix) goto done_unlocked; } - output_end_time = - mix->ts_offset + gst_util_uint64_scale_round (mix->nframes + 1, - GST_SECOND * GST_VIDEO_INFO_FPS_D (&mix->info), - GST_VIDEO_INFO_FPS_N (&mix->info)) + mix->segment.start; if (mix->segment.stop != -1) output_end_time = MIN (output_end_time, mix->segment.stop); -- 2.34.1