Page 1 of 1

Be kinder to libdvdread

Posted: Sun Oct 22, 2006 12:45 pm
by clee
This patch is against upstream HandBrake sources, but it should apply cleanly to your tree.

Also available as http://c133.org/tmp/libhb-dvd.diff - I have some other HandBrake patches to enable anamorphic output - preserving the original MPEG2 frame size and also the aspect ratio headers so that the output file is still (for NTSC, anyway) 720x480, but displays at 854x480 or 720x540. Anybody interested in those?

Code: Select all

Index: libhb/dvd.c
===================================================================
--- libhb/dvd.c	(revision 69)
+++ libhb/dvd.c	(working copy)
@@ -607,7 +607,19 @@
     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 @@
                 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;

Posted: Thu Dec 07, 2006 7:11 pm
by SndChsr
Dynaflash and I are trying to create a new, working version that includes x264 Baseline 3.0 support, as well as other requested changes, and I'd like to incorperate any other useful changes that people have made. Any patches you have created would be great. See the "New Version" thread for information on our progress.

Posted: Thu Dec 07, 2006 7:19 pm
by SndChsr
I've looked at your website and would like to try out your patches. Forgive my ignorance, but could you provide me with some quick instructions on how to apply these patches? I'm good with Cocoa, but not too great with things outside of XCode. :-) Thanks.