mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
API: notify about speed value reset on STOP
This commit is contained in:
@@ -850,6 +850,25 @@ state_changed_signal_data_free (StateChangedSignalData * data)
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
static void
|
||||
rate_notify_dispatch (gpointer user_data)
|
||||
{
|
||||
GstClapper *clapper = user_data;
|
||||
|
||||
if (clapper->inhibit_sigs)
|
||||
return;
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (clapper), param_specs[PROP_RATE]);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_rate_notify (GstClapper * self)
|
||||
{
|
||||
gst_clapper_signal_dispatcher_dispatch (self->signal_dispatcher, self,
|
||||
rate_notify_dispatch, g_object_ref (self),
|
||||
(GDestroyNotify) g_object_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
change_state (GstClapper * self, GstClapperState state)
|
||||
{
|
||||
@@ -861,6 +880,11 @@ change_state (GstClapper * self, GstClapperState state)
|
||||
gst_clapper_state_get_name (state));
|
||||
self->app_state = state;
|
||||
|
||||
if (state == GST_CLAPPER_STATE_STOPPED && self->rate != 1.0) {
|
||||
self->rate = 1.0;
|
||||
emit_rate_notify (self);
|
||||
}
|
||||
|
||||
if (g_signal_handler_find (self, G_SIGNAL_MATCH_ID,
|
||||
signals[SIGNAL_STATE_CHANGED], 0, NULL, NULL, NULL) != 0) {
|
||||
StateChangedSignalData *data = g_new (StateChangedSignalData, 1);
|
||||
@@ -3127,7 +3151,6 @@ gst_clapper_stop_internal (GstClapper * self, gboolean transient)
|
||||
remove_seek_source (self);
|
||||
self->seek_position = GST_CLOCK_TIME_NONE;
|
||||
self->last_seek_time = GST_CLOCK_TIME_NONE;
|
||||
self->rate = 1.0;
|
||||
if (self->collection) {
|
||||
if (self->stream_notify_id)
|
||||
g_signal_handler_disconnect (self->collection, self->stream_notify_id);
|
||||
|
@@ -78,11 +78,6 @@ class ClapperPlayer extends PlayerBase
|
||||
|
||||
set_uri(uri)
|
||||
{
|
||||
/* FIXME: Player does not notify about
|
||||
* rate change after file load */
|
||||
if(this.rate !== 1)
|
||||
this.set_rate(1);
|
||||
|
||||
if(Gst.Uri.get_protocol(uri) !== 'file')
|
||||
return super.set_uri(uri);
|
||||
|
||||
|
Reference in New Issue
Block a user