]> granicus.if.org Git - handbrake/commitdiff
Clee's be nicer with dvdread patch
authorprigaux <pri@nopapers.org>
Thu, 15 Feb 2007 09:42:28 +0000 (09:42 +0000)
committerprigaux <pri@nopapers.org>
Thu, 15 Feb 2007 09:42:28 +0000 (09:42 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.8.0_beta2@340 b64f7644-9d1e-0410-96f1-a4d463321fa5

libmediafork/dvd.c

index 04695a3e26564fbd97cdad2e0559de58770dfba9..aae1c76309bfdf6e05255ec0722a9bc7e143511e 100644 (file)
@@ -607,6 +607,18 @@ int hb_dvd_seek( hb_dvd_t * d, float f )
     return 1;
 }
 
+
+/***********************************************************************
+ * is_nav_pack
+ ***********************************************************************
+ * Pretty much directly lifted from libdvdread's play_title function.
+ **********************************************************************/
+int is_nav_pack( unsigned char *buf )
+{
+    return ( buf[41] == 0xbf && buf[1027] == 0xbf );
+}
+
+
 /***********************************************************************
  * hb_dvd_read
  ***********************************************************************
@@ -632,6 +644,11 @@ int hb_dvd_read( hb_dvd_t * d, hb_buffer_t * b )
                 return 0;
             }
 
+            if ( !is_nav_pack( b->data ) ) { 
+                (d->next_vobu)++;
+                continue;
+            }
+
             navRead_DSI( &dsi_pack, &b->data[DSI_START_BYTE] );
             
             block     = dsi_pack.dsi_gi.nv_pck_lbn;