Be kinder to libdvdread

Archive of historical development discussions
Discussions / Development has moved to GitHub
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
clee
Posts: 19
Joined: Sun Oct 22, 2006 8:57 am

Be kinder to libdvdread

Post 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;
SndChsr
Posts: 20
Joined: Thu Nov 30, 2006 1:53 pm

Post 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.
SndChsr
Posts: 20
Joined: Thu Nov 30, 2006 1:53 pm

Post 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.
Post Reply