mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
API: Disallow pause on very short streams (< 1 sec)
Fixes crash when trying to pause on DVD navigation
This commit is contained in:
@@ -2847,6 +2847,7 @@ gst_clapper_main (gpointer data)
|
|||||||
self->is_live = FALSE;
|
self->is_live = FALSE;
|
||||||
self->rate = 1.0;
|
self->rate = 1.0;
|
||||||
self->seek_mode = DEFAULT_SEEK_MODE;
|
self->seek_mode = DEFAULT_SEEK_MODE;
|
||||||
|
self->cached_duration = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
GST_TRACE_OBJECT (self, "Starting main loop");
|
GST_TRACE_OBJECT (self, "Starting main loop");
|
||||||
g_main_loop_run (self->loop);
|
g_main_loop_run (self->loop);
|
||||||
@@ -3053,12 +3054,15 @@ gst_clapper_pause (GstClapper * self)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GST_IS_CLAPPER (self));
|
g_return_if_fail (GST_IS_CLAPPER (self));
|
||||||
|
|
||||||
g_mutex_lock (&self->lock);
|
/* Do not try to pause on DVD navigation */
|
||||||
self->inhibit_sigs = FALSE;
|
if (G_LIKELY (self->cached_duration > 1000000000)) {
|
||||||
g_mutex_unlock (&self->lock);
|
g_mutex_lock (&self->lock);
|
||||||
|
self->inhibit_sigs = FALSE;
|
||||||
|
g_mutex_unlock (&self->lock);
|
||||||
|
|
||||||
g_main_context_invoke_full (self->context, G_PRIORITY_DEFAULT,
|
g_main_context_invoke_full (self->context, G_PRIORITY_DEFAULT,
|
||||||
gst_clapper_pause_internal, self, NULL);
|
gst_clapper_pause_internal, self, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user