gstplay: support disabling the selected track at startup

In some cases, need to disable some type tracks at startup before
receiving the stream collection message. And fix printing error log
in this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8568>
This commit is contained in:
Elliot Chen 2025-02-28 11:29:56 +09:00
parent 970bfc335e
commit 4b44169f05

View file

@ -1773,7 +1773,7 @@ stream_collection_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg,
return;
g_mutex_lock (&self->lock);
do_default_selection = self->collection != NULL;
do_default_selection = self->collection == NULL;
updated = update_stream_collection (self, collection);
gst_object_unref (collection);
@ -3447,6 +3447,9 @@ gst_play_select_streams (GstPlay * self)
GList *stream_list = NULL;
gboolean ret = FALSE;
if (!self->collection)
return FALSE;
if (self->audio_sid && self->audio_enabled)
stream_list = g_list_append (stream_list, g_strdup (self->audio_sid));
if (self->video_sid && self->video_enabled)