summaryrefslogtreecommitdiffstats
path: root/libhb/reader.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/reader.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/reader.c')
-rw-r--r--libhb/reader.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/libhb/reader.c b/libhb/reader.c
index ec05a4798..037fe0931 100644
--- a/libhb/reader.c
+++ b/libhb/reader.c
@@ -256,13 +256,11 @@ static void ReaderFunc( void * _r )
return;
}
- hb_buffer_t *ps = hb_buffer_init( HB_DVD_READ_BUFFER_SIZE );
if (r->bd)
{
if( !hb_bd_start( r->bd, r->title ) )
{
hb_bd_close( &r->bd );
- hb_buffer_close( &ps );
return;
}
if ( r->job->start_at_preview )
@@ -312,7 +310,6 @@ static void ReaderFunc( void * _r )
if( !hb_dvd_start( r->dvd, r->title, start ) )
{
hb_dvd_close( &r->dvd );
- hb_buffer_close( &ps );
return;
}
if (r->job->angle)
@@ -341,13 +338,13 @@ static void ReaderFunc( void * _r )
// Find out what the first timestamp of the stream is
// and then seek to the appropriate offset from it
- if ( hb_stream_read( r->stream, ps ) )
+ if ( ( buf = hb_stream_read( r->stream ) ) )
{
- if ( ps->start > 0 )
+ if ( buf->start > 0 )
{
- pts_to_start += ps->start;
- r->pts_to_start += ps->start;
- r->job->pts_to_start += ps->start;
+ pts_to_start += buf->start;
+ r->pts_to_start += buf->start;
+ r->job->pts_to_start += buf->start;
}
}
@@ -408,21 +405,21 @@ static void ReaderFunc( void * _r )
if (r->bd)
{
- if( !hb_bd_read( r->bd, ps ) )
+ if( (buf = hb_bd_read( r->bd )) == NULL )
{
break;
}
}
else if (r->dvd)
{
- if( !hb_dvd_read( r->dvd, ps ) )
+ if( (buf = hb_dvd_read( r->dvd )) == NULL )
{
break;
}
}
else if (r->stream)
{
- if ( !hb_stream_read( r->stream, ps ) )
+ if ( (buf = hb_stream_read( r->stream )) == NULL )
{
break;
}
@@ -431,11 +428,11 @@ static void ReaderFunc( void * _r )
// We will inspect the timestamps of each frame in sync
// to skip from this seek point to the timestamp we
// want to start at.
- if ( ps->start > 0 && ps->start < r->job->pts_to_start )
+ if ( buf->start > 0 && buf->start < r->job->pts_to_start )
{
- r->job->pts_to_start -= ps->start;
+ r->job->pts_to_start -= buf->start;
}
- else if ( ps->start >= r->job->pts_to_start )
+ else if ( buf->start >= r->job->pts_to_start )
{
r->job->pts_to_start = 0;
r->start_found = 1;
@@ -465,7 +462,7 @@ static void ReaderFunc( void * _r )
hb_set_state( r->job->h, &state );
}
- (hb_demux[r->title->demuxer])( ps, list, &r->demux );
+ (hb_demux[r->title->demuxer])( buf, list, &r->demux );
while( ( buf = hb_list_item( list, 0 ) ) )
{
@@ -486,7 +483,7 @@ static void ReaderFunc( void * _r )
// offset will get computed correctly.
id_to_st( r, buf, 1 );
r->saw_video = 1;
- hb_log( "reader: first SCR %"PRId64" id %d DTS %"PRId64,
+ hb_log( "reader: first SCR %"PRId64" id 0x%x DTS %"PRId64,
r->demux.last_scr, buf->id, buf->renderOffset );
}
else
@@ -604,7 +601,6 @@ static void ReaderFunc( void * _r )
}
hb_list_empty( &list );
- hb_buffer_close( &ps );
if (r->bd)
{
hb_bd_stop( r->bd );