[totem/wip/hadess/none-sub-selection] backend: Fix "None" subtitle not selected when opening file
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/none-sub-selection] backend: Fix "None" subtitle not selected when opening file
- Date: Mon, 14 Feb 2022 10:17:42 +0000 (UTC)
commit a8497509cc30ad76ed0e7bc780258d33c424b4cc
Author: Bastien Nocera <hadess hadess net>
Date: Mon Feb 14 11:15:36 2022 +0100
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.
src/backend/bacon-video-widget.c | 3 +++
1 file changed, 3 insertions(+)
---
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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]