gstplay: avoid getting property of playbin2 if subtitle_sid is null

There is a probability of getting "current-text" property
 when play with playbin3, and this property is available
 only in playbin2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4661>
This commit is contained in:
Elliot Chen 2023-03-02 18:09:54 +08:00 committed by GStreamer Marge Bot
parent cd20649450
commit fc0ada9e63

View file

@ -1762,9 +1762,11 @@ gst_play_subtitle_info_update (GstPlay * self, GstPlayStreamInfo * stream_info)
g_object_get (G_OBJECT (self->playbin), "current-suburi", &suburi, NULL); g_object_get (G_OBJECT (self->playbin), "current-suburi", &suburi, NULL);
if (suburi) { if (suburi) {
if (self->use_playbin3 && self->subtitle_sid) { if (self->use_playbin3) {
if (g_str_equal (self->subtitle_sid, stream_info->stream_id)) if (self->subtitle_sid &&
g_str_equal (self->subtitle_sid, stream_info->stream_id)) {
info->language = g_path_get_basename (suburi); info->language = g_path_get_basename (suburi);
}
} else { } else {
g_object_get (G_OBJECT (self->playbin), "current-text", &text_index, g_object_get (G_OBJECT (self->playbin), "current-text", &text_index,
NULL); NULL);