summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliot Chen <elliot.chen@nxp.com>2023-03-02 18:09:54 +0800
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-17 19:22:28 +0000
commitfc0ada9e63a9902dec70198be6fbf5fce742350b (patch)
tree7c99f0f7d13db5e17241ae560d4817d9a89e737e
parentcd206494501591b0f7309ed2c92f7dfb535999eb (diff)
downloadgstreamer-1.22.tar.gz
gstplay: avoid getting property of playbin2 if subtitle_sid is null1.22
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>
-rw-r--r--subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c b/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c
index f99bbe1bcd..c88d8e94c2 100644
--- a/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c
+++ b/subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c
@@ -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);
if (suburi) {
- if (self->use_playbin3 && self->subtitle_sid) {
- if (g_str_equal (self->subtitle_sid, stream_info->stream_id))
+ if (self->use_playbin3) {
+ if (self->subtitle_sid &&
+ g_str_equal (self->subtitle_sid, stream_info->stream_id)) {
info->language = g_path_get_basename (suburi);
+ }
} else {
g_object_get (G_OBJECT (self->playbin), "current-text", &text_index,
NULL);