Skip to content

Commit

Permalink
Fix libdvdnav dvd name and add additional fallback if no name is found
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6744 b64f7644-9d1e-0410-96f1-a4d463321fa5
  • Loading branch information
galad87 committed Jan 13, 2015
1 parent 2c5ec03 commit acac8a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions contrib/libdvdnav/A01-name.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/src/vm/vm.c
+++ b/src/vm/vm.c
@@ -402,6 +402,7 @@
/* return 0; Not really used for now.. */
}
/* ifoRead_TXTDT_MGI(vmgi); Not implemented yet */
+ dvd_read_name(vm->dvd_name, vm->dvd_serial, dvdroot);
}
if (vm->vmgi) {
int i, mask;
9 changes: 8 additions & 1 deletion libhb/dvdnav.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
uint64_t duration, longest;
int longest_pgcn, longest_pgn, longest_pgcn_end;
const char * name;
unsigned char unused[1024];
const char * codec_name;

hb_log( "scan: scanning title %d", t );
Expand All @@ -344,8 +345,13 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
{
strncpy( title->name, name, sizeof( title->name ) );
}
else

if (strlen(title->name) == 0)
{
if( DVDUDFVolumeInfo( d->reader, title->name, sizeof( title->name ),
unused, sizeof( unused ) ) )
{

char * p_cur, * p_last = d->path;
for( p_cur = d->path; *p_cur; p_cur++ )
{
Expand All @@ -358,6 +364,7 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
char *dot_term = strrchr(title->name, '.');
if (dot_term)
*dot_term = '\0';
}
}

/* VTS which our title is in */
Expand Down

0 comments on commit acac8a0

Please sign in to comment.