From 63a726b5e80d17083b0f8bf3e96c5749df45bc98 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Fri, 22 Apr 2011 14:51:59 +0000 Subject: Add support for TrueHD and DTS-HD from BD sources TrueHD and DTS-HD now show up in the audio list along side their AC-3 and DTS counterparts. Note that currently the DTS-HD decoder we are using (ffmpeg) discards the HD portion of the stream and onle decodes the DTS core portion. So there is no advantage yet to using the DTS-HD stream. In the future I would like to add DTS-HD passthru support and hopefully ffmpeg will improve their DTS-HD decoder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3950 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/dvd.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'libhb/dvd.c') diff --git a/libhb/dvd.c b/libhb/dvd.c index 2d18dee71..c5c052223 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -20,7 +20,7 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * d, int t, uint64_t min_du static int hb_dvdread_start( hb_dvd_t * d, hb_title_t *title, int chapter ); static void hb_dvdread_stop( hb_dvd_t * d ); static int hb_dvdread_seek( hb_dvd_t * d, float f ); -static int hb_dvdread_read( hb_dvd_t * d, hb_buffer_t * b ); +static hb_buffer_t * hb_dvdread_read( hb_dvd_t * d ); static int hb_dvdread_chapter( hb_dvd_t * d ); static int hb_dvdread_angle_count( hb_dvd_t * d ); static void hb_dvdread_set_angle( hb_dvd_t * d, int angle ); @@ -840,9 +840,10 @@ int is_nav_pack( unsigned char *buf ) *********************************************************************** * **********************************************************************/ -static int hb_dvdread_read( hb_dvd_t * e, hb_buffer_t * b ) +static hb_buffer_t * hb_dvdread_read( hb_dvd_t * e ) { hb_dvdread_t *d = &(e->dvdread); + hb_buffer_t *b = hb_buffer_init( HB_DVD_READ_BUFFER_SIZE ); top: if( !d->pack_len ) { @@ -855,7 +856,10 @@ static int hb_dvdread_read( hb_dvd_t * e, hb_buffer_t * b ) // is probably invalid. Just return 'no data' & our caller // should check and discover we're at eof. if ( d->cell_cur > d->cell_end ) - return 0; + { + hb_buffer_close( &b ); + return NULL; + } for( ;; ) { @@ -896,7 +900,10 @@ static int hb_dvdread_read( hb_dvd_t * e, hb_buffer_t * b ) d->next_vobu, d->cell_next ); d->cell_cur = d->cell_next; if ( d->cell_cur > d->cell_end ) - return 0; + { + hb_buffer_close( &b ); + return NULL; + } d->in_cell = 0; d->next_vobu = d->pgc->cell_playback[d->cell_cur].first_sector; FindNextCell( d ); @@ -994,7 +1001,8 @@ static int hb_dvdread_read( hb_dvd_t * e, hb_buffer_t * b ) if( ++error > 1024 ) { hb_log( "dvd: couldn't find a VOBU after 1024 blocks" ); - return 0; + hb_buffer_close( &b ); + return NULL; } (d->next_vobu)++; @@ -1099,7 +1107,7 @@ static int hb_dvdread_read( hb_dvd_t * e, hb_buffer_t * b ) d->block++; - return 1; + return b; } /*********************************************************************** @@ -1303,9 +1311,9 @@ int hb_dvd_seek( hb_dvd_t * d, float f ) return dvd_methods->seek(d, f); } -int hb_dvd_read( hb_dvd_t * d, hb_buffer_t * b ) +hb_buffer_t * hb_dvd_read( hb_dvd_t * d ) { - return dvd_methods->read(d, b); + return dvd_methods->read(d); } int hb_dvd_chapter( hb_dvd_t * d ) -- cgit v1.2.3