diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-02-14 11:15:36 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-02-14 11:17:31 +0100 |
commit | a8497509cc30ad76ed0e7bc780258d33c424b4cc (patch) | |
tree | 28f96ec73422827198a558be5cc9a5c8c71a5280 /src/backend | |
parent | 25e6ed55ba42e3269deca6d2df1f5935a69fded4 (diff) | |
download | totem-a8497509cc30ad76ed0e7bc780258d33c424b4cc.tar.gz |
backend: Fix "None" subtitle not selected when opening file
When opening a file, the GST_PLAY_FLAG_TEXT flag is set because we
want to be able to show a default subtitle track if any is selected.
But that means that bacon_video_widget_get_subtitle() will return
-1 (automatic) instead of -2 (none).
Check whether we have a single subtitle track (which must be "none") and
claim it was selected when checking the current subtitle.
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/bacon-video-widget.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c index 554a74c78..bd3d16bc8 100644 --- a/src/backend/bacon-video-widget.c +++ b/src/backend/bacon-video-widget.c @@ -2601,6 +2601,9 @@ bacon_video_widget_get_subtitle (BaconVideoWidget * bvw) g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), BVW_TRACK_NONE); g_return_val_if_fail (bvw->play != NULL, BVW_TRACK_NONE); + if (g_list_length (bvw->subtitles) == 1) + return BVW_TRACK_NONE; + g_object_get (bvw->play, "flags", &flags, NULL); if ((flags & GST_PLAY_FLAG_TEXT) == 0) |