mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 06:58:49 +00:00
play: Fix stream id leaks on initial stream selection
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7650>
This commit is contained in:
parent
13ed55f0ee
commit
9909654a9a
1 changed files with 5 additions and 0 deletions
|
@ -1667,12 +1667,15 @@ stream_collection_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg,
|
||||||
const gchar *stream_id = gst_stream_get_stream_id (stream);
|
const gchar *stream_id = gst_stream_get_stream_id (stream);
|
||||||
|
|
||||||
if ((stream_type & GST_STREAM_TYPE_AUDIO) && select_audio) {
|
if ((stream_type & GST_STREAM_TYPE_AUDIO) && select_audio) {
|
||||||
|
g_free (self->audio_sid);
|
||||||
self->audio_sid = g_strdup (stream_id);
|
self->audio_sid = g_strdup (stream_id);
|
||||||
select_audio = FALSE;
|
select_audio = FALSE;
|
||||||
} else if ((stream_type & GST_STREAM_TYPE_VIDEO) && select_video) {
|
} else if ((stream_type & GST_STREAM_TYPE_VIDEO) && select_video) {
|
||||||
|
g_free (self->video_sid);
|
||||||
self->video_sid = g_strdup (stream_id);
|
self->video_sid = g_strdup (stream_id);
|
||||||
select_video = FALSE;
|
select_video = FALSE;
|
||||||
} else if ((stream_type & GST_STREAM_TYPE_TEXT) && select_subtitle) {
|
} else if ((stream_type & GST_STREAM_TYPE_TEXT) && select_subtitle) {
|
||||||
|
g_free (self->subtitle_sid);
|
||||||
self->subtitle_sid = g_strdup (stream_id);
|
self->subtitle_sid = g_strdup (stream_id);
|
||||||
select_subtitle = FALSE;
|
select_subtitle = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1718,9 +1721,11 @@ streams_selected_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg,
|
||||||
GstStreamType stream_type;
|
GstStreamType stream_type;
|
||||||
const gchar *stream_id;
|
const gchar *stream_id;
|
||||||
gchar **current_sid;
|
gchar **current_sid;
|
||||||
|
|
||||||
stream = gst_message_streams_selected_get_stream (msg, i);
|
stream = gst_message_streams_selected_get_stream (msg, i);
|
||||||
stream_type = gst_stream_get_stream_type (stream);
|
stream_type = gst_stream_get_stream_type (stream);
|
||||||
stream_id = gst_stream_get_stream_id (stream);
|
stream_id = gst_stream_get_stream_id (stream);
|
||||||
|
|
||||||
if (stream_type & GST_STREAM_TYPE_AUDIO)
|
if (stream_type & GST_STREAM_TYPE_AUDIO)
|
||||||
current_sid = &self->audio_sid;
|
current_sid = &self->audio_sid;
|
||||||
else if (stream_type & GST_STREAM_TYPE_VIDEO)
|
else if (stream_type & GST_STREAM_TYPE_VIDEO)
|
||||||
|
|
Loading…
Reference in a new issue