[totem/wip/hadess/small-fixes: 4/4] backend: Export subtitle/lang track titles




commit becbe7f8ef61f51ccbbb228f248b85b02e1eeab9
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 10 23:55:53 2022 +0100

    backend: Export subtitle/lang track titles

 src/backend/bacon-video-widget.c |  2 ++
 src/backend/bacon-video-widget.h | 10 ++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 08bbab0ce..e85e6e119 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -2775,6 +2775,7 @@ get_lang_list_for_type (BaconVideoWidget * bvw, const gchar * type_name)
 
     if (tags) {
       gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &info->language);
+      gst_tag_list_get_string (tags, GST_TAG_TITLE, &info->title);
       if (g_str_equal (type_name, "AUDIO"))
        gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &info->codec);
 
@@ -2800,6 +2801,7 @@ bacon_video_widget_lang_info_free (BvwLangInfo *info)
 {
   if (info == NULL)
     return;
+  g_free (info->title);
   g_free (info->language);
   g_free (info->codec);
   g_free (info);
diff --git a/src/backend/bacon-video-widget.h b/src/backend/bacon-video-widget.h
index 23764b6f2..a115301e2 100644
--- a/src/backend/bacon-video-widget.h
+++ b/src/backend/bacon-video-widget.h
@@ -339,15 +339,17 @@ void bacon_video_widget_dvd_event                (BaconVideoWidget *bvw,
 
 /**
  * BvwLangInfo:
+ * @title: the title of the track, or %NULL if unset.
  * @language: the ISO-639 language code for the track, or "und" if unknown.
- * Can never be %NULL.
+ *   Can never be %NULL.
  * @codec: the codec for the track, or %NULL if unknown or unset.
  *
- * #BvwLangInfo holds the language code and codec for each subtitle
- * or audio track for a media, which would allow the front-ends to
- * present appropriate information to the user.
+ * #BvwLangInfo holds the title, language code and codec for each
+ * subtitle or audio track for a media, which would allow the
+ * front-ends to present appropriate information to the user.
  */
 typedef struct {
+       char *title;
        char *language;
        char *codec;
 } BvwLangInfo;


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