From 8ede252a8a3da38a63e1ce8a27a29313f29efc16 Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Wed, 1 Aug 2018 15:11:09 +0300 Subject: [PATCH] avwait: Don't wait if audio_running_time_to_wait_for is NONE The case is properly handled a few lines below by dropping the buffer. We shouldn't perpetually block the audio chain function until the target-timecode is reached. https://bugzilla.gnome.org/show_bug.cgi?id=796906 --- gst/timecode/gstavwait.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gst/timecode/gstavwait.c b/gst/timecode/gstavwait.c index c2a37c76ed..e205506345 100644 --- a/gst/timecode/gstavwait.c +++ b/gst/timecode/gstavwait.c @@ -836,15 +836,7 @@ gst_avwait_vsink_chain (GstPad * pad, GstObject * parent, GstBuffer * inbuf) gst_avwait_send_element_message (self, TRUE, running_time); } else if (running_time < self->running_time_to_wait_for && self->running_time_to_wait_for != GST_CLOCK_TIME_NONE) { - /* We should set audio_running_time_to_wait_for to a value far enough - * in the future, so that it will never be reached. However, setting - * it to GST_CLOCK_TIME_NONE would eternally trigger the g_cond_wait - * in the audio chain function, causing audio upstream to be queued up - * forever. There is already code in place to ensure that audio will - * not exceed the video at the same place, so we just set it to - * GST_CLOCK_TIME_NONE - 1 here to ensure it will never be reached, - * but still not trigger the eternal waiting code */ - self->audio_running_time_to_wait_for = GST_CLOCK_TIME_NONE - 1; + self->audio_running_time_to_wait_for = GST_CLOCK_TIME_NONE; } } /* Recording is FALSE: we drop all buffers */ @@ -959,9 +951,7 @@ gst_avwait_asink_chain (GstPad * pad, GstObject * parent, GstBuffer * inbuf) (video_running_time == GST_CLOCK_TIME_NONE /* Wait if audio is after the video: dunno what to do */ || gst_avwait_compare_guint64_with_signs (asign, - running_time_at_end, vsign, video_running_time) == 1 - /* Wait if we don't even know what to wait for yet */ - || self->audio_running_time_to_wait_for == GST_CLOCK_TIME_NONE)) { + running_time_at_end, vsign, video_running_time) == 1)) { g_cond_wait (&self->cond, &self->mutex); vsign = gst_segment_to_running_time_full (&self->vsegment, GST_FORMAT_TIME,