]> granicus.if.org Git - handbrake/commitdiff
dvd: Add support for MPEG-1 on DVD
authorJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 10 Feb 2019 19:08:53 +0000 (12:08 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 11 Feb 2019 14:26:45 +0000 (06:26 -0800)
Use video attributes from IFO file to set video stream type.

May fix https://github.com/HandBrake/HandBrake/issues/1880

libhb/dvd.c
libhb/dvdnav.c

index 97d875aaac1c81d3612bb34baf0ad59c0d8cda48..5708934bfa93aa96cd93ab8bb904a161d53fd200 100644 (file)
@@ -735,6 +735,24 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
             goto fail;
     }
 
+    switch( vts->vtsi_mat->vts_video_attr.mpeg_version )
+    {
+        case 0:
+            title->video_codec       = WORK_DECAVCODECV;
+            title->video_codec_param = AV_CODEC_ID_MPEG1VIDEO;
+            break;
+        case 1:
+            title->video_codec       = WORK_DECAVCODECV;
+            title->video_codec_param = AV_CODEC_ID_MPEG2VIDEO;
+            break;
+        default:
+            hb_log("scan: unknown/reserved MPEG version %d",
+                    vts->vtsi_mat->vts_video_attr.mpeg_version);
+            title->video_codec       = WORK_DECAVCODECV;
+            title->video_codec_param = AV_CODEC_ID_MPEG2VIDEO;
+            break;
+    }
+
     hb_log("scan: aspect = %d:%d",
            title->container_dar.num, title->container_dar.den);
 
index 99602b5d81da0a768e8c19cb394aef52f6f7dbc9..5a3782cbb91b1639c44cf7b86889440c171eb8b1 100644 (file)
@@ -928,6 +928,24 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
             goto fail;
     }
 
+    switch( ifo->vtsi_mat->vts_video_attr.mpeg_version )
+    {
+        case 0:
+            title->video_codec       = WORK_DECAVCODECV;
+            title->video_codec_param = AV_CODEC_ID_MPEG1VIDEO;
+            break;
+        case 1:
+            title->video_codec       = WORK_DECAVCODECV;
+            title->video_codec_param = AV_CODEC_ID_MPEG2VIDEO;
+            break;
+        default:
+            hb_log("scan: unknown/reserved MPEG version %d",
+                    ifo->vtsi_mat->vts_video_attr.mpeg_version);
+            title->video_codec       = WORK_DECAVCODECV;
+            title->video_codec_param = AV_CODEC_ID_MPEG2VIDEO;
+            break;
+    }
+
     hb_log("scan: aspect = %d:%d",
            title->container_dar.num, title->container_dar.den);