diff options
author | jstebbins <[email protected]> | 2011-04-22 14:51:59 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-04-22 14:51:59 +0000 |
commit | 63a726b5e80d17083b0f8bf3e96c5749df45bc98 (patch) | |
tree | fd57fe76264f11a0fb6c20a7701e944de81b5466 /libhb/scan.c | |
parent | 263b4ff38b4b4cb695e1b7a1e69571fd7e621145 (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/scan.c')
-rw-r--r-- | libhb/scan.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libhb/scan.c b/libhb/scan.c index 7b563638a..247e25028 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -461,14 +461,13 @@ static void most_common_info( info_list_t *info_list, hb_work_info_t *info ) static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) { int i, npreviews = 0; - hb_buffer_t * buf_ps, * buf_es; + hb_buffer_t * buf, * buf_es; hb_list_t * list_es; int progressive_count = 0; int interlaced_preview_count = 0; info_list_t * info_list = calloc( data->preview_count+1, sizeof(*info_list) ); crop_record_t *crops = calloc( 1, sizeof(*crops) ); - buf_ps = hb_buffer_init( HB_DVD_READ_BUFFER_SIZE ); list_es = hb_list_init(); hb_log( "scan: decoding previews for title %d", title->index ); @@ -563,7 +562,7 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) { if (data->bd) { - if( !hb_bd_read( data->bd, buf_ps ) ) + if( (buf = hb_bd_read( data->bd )) == NULL ) { if ( vid_buf ) { @@ -573,9 +572,9 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) goto skip_preview; } } - if (data->dvd) + else if (data->dvd) { - if( !hb_dvd_read( data->dvd, buf_ps ) ) + if( (buf = hb_dvd_read( data->dvd )) == NULL ) { if ( vid_buf ) { @@ -587,7 +586,7 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) } else if (data->stream) { - if ( !hb_stream_read(data->stream,buf_ps) ) + if ( (buf = hb_stream_read( data->stream )) == NULL ) { if ( vid_buf ) { @@ -597,7 +596,15 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) goto skip_preview; } } - (hb_demux[title->demuxer])(buf_ps, list_es, 0 ); + else + { + // Silence compiler warning + buf = NULL; + hb_error( "Error: This can't happen!" ); + goto skip_preview; + } + + (hb_demux[title->demuxer])(buf, list_es, 0 ); while( ( buf_es = hb_list_item( list_es, 0 ) ) ) { @@ -900,7 +907,6 @@ skip_preview: } } - hb_buffer_close( &buf_ps ); while( ( buf_es = hb_list_item( list_es, 0 ) ) ) { hb_list_rem( list_es, buf_es ); @@ -957,7 +963,7 @@ static void LookForAudio( hb_title_t * title, hb_buffer_t * b ) if ( audio->priv.scan_cache == NULL ) audio->priv.scan_cache = hb_fifo_init( 16, 16 ); - if ( hb_fifo_size_bytes( audio->priv.scan_cache ) >= 4096 ) + if ( hb_fifo_size_bytes( audio->priv.scan_cache ) >= 16384 ) { hb_buffer_t * tmp; tmp = hb_fifo_get( audio->priv.scan_cache ); |