OSDN Git Service

LinGui: make Help->Guide work on windows/mingw
[handbrake-jp/handbrake-jp-git.git] / libhb / scan.c
index f93e6a2..68188a2 100644 (file)
@@ -69,6 +69,7 @@ static void ScanFunc( void * _data )
     hb_scan_t  * data = (hb_scan_t *) _data;
     hb_title_t * title;
     int          i;
+    int          feature = 0;
 
        data->dvd = NULL;
        data->stream = NULL;
@@ -93,6 +94,7 @@ static void ScanFunc( void * _data )
                 hb_list_add( data->list_title,
                              hb_dvd_title_scan( data->dvd, i + 1 ) );
             }
+            feature = hb_dvd_main_feature( data->dvd, data->list_title );
         }
     }
     else if ( ( data->batch = hb_batch_init( data->path ) ) )
@@ -171,6 +173,22 @@ static void ScanFunc( void * _data )
             j++;
         }
 
+        if ( data->dvd )
+        {
+            // The subtitle width and height needs to be set to the 
+            // title widht and height for DVDs.  title width and
+            // height don't get set until we decode previews, so
+            // we can't set subtitle width/height till we get here.
+            for( j = 0; j < hb_list_count( title->list_subtitle ); j++ )
+            {
+                hb_subtitle_t *subtitle = hb_list_item( title->list_subtitle, j );
+                if ( subtitle->source == VOBSUB )
+                {
+                    subtitle->width = title->width;
+                    subtitle->height = title->height;
+                }
+            }
+        }
         i++;
     }
 
@@ -184,6 +202,7 @@ static void ScanFunc( void * _data )
         title->job = job;
 
         job->title = title;
+        job->feature = feature;
 
         /* Set defaults settings */
         job->chapter_start = 1;