API: unset needs_info_update when stopped

This commit is contained in:
Rafał Dzięgiel
2021-04-15 11:30:55 +02:00
parent a717e481e8
commit adbcfecb5e

View File

@@ -880,9 +880,9 @@ static void
emit_media_info_updated (GstClapper * self) emit_media_info_updated (GstClapper * self)
{ {
MediaInfoUpdatedSignalData *data = g_new (MediaInfoUpdatedSignalData, 1); MediaInfoUpdatedSignalData *data = g_new (MediaInfoUpdatedSignalData, 1);
self->needs_info_update = FALSE;
data->clapper = g_object_ref (self); data->clapper = g_object_ref (self);
g_mutex_lock (&self->lock); g_mutex_lock (&self->lock);
self->needs_info_update = FALSE;
data->info = gst_clapper_media_info_copy (self->media_info); data->info = gst_clapper_media_info_copy (self->media_info);
g_mutex_unlock (&self->lock); g_mutex_unlock (&self->lock);
@@ -946,9 +946,12 @@ change_state (GstClapper * self, GstClapperState state)
gst_clapper_state_get_name (state)); gst_clapper_state_get_name (state));
self->app_state = state; self->app_state = state;
if (state == GST_CLAPPER_STATE_STOPPED && self->rate != 1.0) { if (state == GST_CLAPPER_STATE_STOPPED) {
self->rate = 1.0; self->needs_info_update = FALSE;
emit_rate_notify (self); if (self->rate != 1.0) {
self->rate = 1.0;
emit_rate_notify (self);
}
} }
if (g_signal_handler_find (self, G_SIGNAL_MATCH_ID, if (g_signal_handler_find (self, G_SIGNAL_MATCH_ID,
@@ -2343,9 +2346,10 @@ stream_notify_cb (GstStreamCollection * collection, GstStream * stream,
g_mutex_lock (&self->lock); g_mutex_lock (&self->lock);
info = info =
gst_clapper_stream_info_find_from_stream_id (self->media_info, stream_id); gst_clapper_stream_info_find_from_stream_id (self->media_info, stream_id);
if (info) if (info) {
gst_clapper_stream_info_update_from_stream (self, info, stream); gst_clapper_stream_info_update_from_stream (self, info, stream);
emit_update = (self->needs_info_update && GST_IS_CLAPPER_VIDEO_INFO (info)); emit_update = (self->needs_info_update && GST_IS_CLAPPER_VIDEO_INFO (info));
}
g_mutex_unlock (&self->lock); g_mutex_unlock (&self->lock);
if (emit_update) if (emit_update)