summaryrefslogtreecommitdiffstats
path: root/libhb/dvd.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-04-22 14:51:59 +0000
committerjstebbins <[email protected]>2011-04-22 14:51:59 +0000
commit63a726b5e80d17083b0f8bf3e96c5749df45bc98 (patch)
treefd57fe76264f11a0fb6c20a7701e944de81b5466 /libhb/dvd.c
parent263b4ff38b4b4cb695e1b7a1e69571fd7e621145 (diff)
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
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r--libhb/dvd.c24
1 files changed, 16 insertions, 8 deletions
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 )