[totem/wip/hadess/simplify-text-sub: 3/5] backend: Always add a "None" choice for subtitles




commit 7a07dd0228b65580b84d6a54c657479c709350ef
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 11 20:16:22 2022 +0100

    backend: Always add a "None" choice for subtitles
    
    Because even if there's no subtitles, there's "None".

 src/backend/bacon-video-widget.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index f500607ac..804fe43be 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -2919,17 +2919,16 @@ static gboolean
 update_subtitles_tracks (BaconVideoWidget *bvw)
 {
   g_autolist(BvwLangInfo) list;
+  BvwLangInfo *info;
 
   list = get_lang_list_for_type (bvw, "TEXT");
 
-  /* Add "none" if there's subs */
-  if (list != NULL || bvw->subtitle_uri != NULL) {
-    BvwLangInfo *info;
-    info = g_new0 (BvwLangInfo, 1);
-    info->id = BVW_TRACK_NONE;
-    info->codec = g_strdup ("none");
-    list = g_list_prepend (list, info);
-  }
+  /* Add "None" */
+  info = g_new0 (BvwLangInfo, 1);
+  info->id = BVW_TRACK_NONE;
+  info->codec = g_strdup ("none");
+  list = g_list_prepend (list, info);
+
   if (bvw_lang_infos_equal (list, bvw->subtitles))
     return FALSE;
   if (bvw->subtitles)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]