]> granicus.if.org Git - handbrake/commitdiff
dvd: add widescreen/letterbox/pan&scan/4:3 to vobsub description
authorJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 13 Oct 2016 18:50:05 +0000 (11:50 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 21 Feb 2017 21:04:52 +0000 (14:04 -0700)
libhb/dvd.c
libhb/dvd.h
libhb/dvdnav.c

index 72471655195c45a32b24d5b0f63d256acf854cb6..1cca5b98f8679f661593fc61a44b4f6879448434 100644 (file)
@@ -175,7 +175,7 @@ static int hb_dvdread_title_count( hb_dvd_t * e )
 
 static void add_subtitle( hb_list_t * list_subtitle, int position,
                           iso639_lang_t * lang, int lang_extension,
-                          uint32_t * palette )
+                          uint32_t * palette, int style )
 {
     hb_subtitle_t * subtitle;
     int ii, count;
@@ -242,6 +242,22 @@ static void add_subtitle( hb_list_t * list_subtitle, int position,
             break;
     }
 
+    switch (style)
+    {
+        case HB_VOBSUB_STYLE_4_3:
+            strcat( subtitle->lang, " (4:3)" );
+            break;
+        case HB_VOBSUB_STYLE_WIDE:
+            strcat( subtitle->lang, " (Wide Screen)" );
+            break;
+        case HB_VOBSUB_STYLE_LETTERBOX:
+            strcat( subtitle->lang, " (Letterbox)" );
+            break;
+        case HB_VOBSUB_STYLE_PANSCAN:
+            strcat( subtitle->lang, " (Pan & Scan)" );
+            break;
+    }
+
     hb_log( "scan: id=0x%x, lang=%s, 3cc=%s ext=%i", subtitle->id,
             subtitle->lang, subtitle->iso639_2, lang_extension );
 
@@ -558,7 +574,8 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
             // Add Wide Screen subtitle.
             pos = (spu_control >> 16) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette);
+                       vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                       HB_VOBSUB_STYLE_WIDE);
 
             // permitted_df
             // 1 - Letterbox not permitted
@@ -569,21 +586,24 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
                 // Letterbox permitted.  Add Letterbox subtitle.
                 pos = (spu_control >> 8) & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette);
+                           vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                           HB_VOBSUB_STYLE_LETTERBOX);
             }
             if (!(vts->vtsi_mat->vts_video_attr.permitted_df & 2))
             {
                 // Pan&Scan permitted.  Add Pan&Scan subtitle.
                 pos = spu_control & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette);
+                           vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                           HB_VOBSUB_STYLE_PANSCAN);
             }
         }
         else
         {
             pos = (spu_control >> 24) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette);
+                       vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                       HB_VOBSUB_STYLE_4_3);
         }
     }
 
index 8a8e4b89d4ff8eaf5653e457c6d321059dd1d1b1..4ecbf2420e00365dce5a7dc7299f4c0df0818b6a 100644 (file)
 #include "dvdread/ifo_read.h"
 #include "dvdread/nav_read.h"
 
+#define HB_VOBSUB_STYLE_4_3        0
+#define HB_VOBSUB_STYLE_WIDE       1
+#define HB_VOBSUB_STYLE_LETTERBOX  2
+#define HB_VOBSUB_STYLE_PANSCAN    3
+
 struct hb_dvdread_s
 {
     char         * path;
index 671806c546b835bceee9c7be432ad02a187f3dde..ed7dd26c7ddfd04becfd495dd5970e7eb761b126 100644 (file)
@@ -319,7 +319,7 @@ PttDuration(ifo_handle_t *ifo, int ttn, int pttn, int *blocks, int *last_pgcn)
 
 static void add_subtitle( hb_list_t * list_subtitle, int position,
                           iso639_lang_t * lang, int lang_extension,
-                          uint32_t * palette )
+                          uint32_t * palette, int style )
 {
     hb_subtitle_t * subtitle;
     int ii, count;
@@ -386,6 +386,22 @@ static void add_subtitle( hb_list_t * list_subtitle, int position,
             break;
     }
 
+    switch (style)
+    {
+        case HB_VOBSUB_STYLE_4_3:
+            strcat( subtitle->lang, " (4:3)" );
+            break;
+        case HB_VOBSUB_STYLE_WIDE:
+            strcat( subtitle->lang, " (Wide Screen)" );
+            break;
+        case HB_VOBSUB_STYLE_LETTERBOX:
+            strcat( subtitle->lang, " (Letterbox)" );
+            break;
+        case HB_VOBSUB_STYLE_PANSCAN:
+            strcat( subtitle->lang, " (Pan & Scan)" );
+            break;
+    }
+
     hb_log( "scan: id=0x%x, lang=%s, 3cc=%s ext=%i", subtitle->id,
             subtitle->lang, subtitle->iso639_2, lang_extension );
 
@@ -738,7 +754,8 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
             // Add Wide Screen subtitle.
             pos = (spu_control >> 16) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette);
+                       ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                       HB_VOBSUB_STYLE_WIDE);
 
             // permitted_df
             // 1 - Letterbox not permitted
@@ -749,21 +766,24 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
                 // Letterbox permitted.  Add Letterbox subtitle.
                 pos = (spu_control >> 8) & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette);
+                           ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                           HB_VOBSUB_STYLE_LETTERBOX);
             }
             if (!(ifo->vtsi_mat->vts_video_attr.permitted_df & 2))
             {
                 // Pan&Scan permitted.  Add Pan&Scan subtitle.
                 pos = spu_control & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette);
+                           ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                           HB_VOBSUB_STYLE_PANSCAN);
             }
         }
         else
         {
             pos = (spu_control >> 24) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette);
+                       ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                           HB_VOBSUB_STYLE_4_3);
         }
     }