diff options
author | jstebbins <[email protected]> | 2011-09-19 15:35:46 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-09-19 15:35:46 +0000 |
commit | d36f10c33b9f9f85134f70fc785e2523177b2444 (patch) | |
tree | e6906a5b917569d17da651ab6b897865609994d3 /libhb/scan.c | |
parent | d145ee9d9ed7be65b83124afbf0cc71b60adddc6 (diff) |
Fix corrupt first frame in BD point-to-point
Seek point may be a recovery point which will not be a complete clean
frame. So consume frames till we reach the recovery frame count.
Patches Libav so it can tell us when the recovery point has been
reached.
Also improves detection of recovery points in TS files.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4231 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/scan.c')
-rw-r--r-- | libhb/scan.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/libhb/scan.c b/libhb/scan.c index 3582f7d64..73b39e376 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -569,25 +569,6 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) vid_decoder->flush( vid_decoder ); hb_buffer_t * vid_buf = NULL; - int vidskip = 0; - - if ( title->flags & HBTF_NO_IDR ) - { - // title doesn't have IDR frames so we decode but drop one second's - // worth of frames to allow the decoder to converge. - if ( ! title->rate_base ) - { - vidskip = 30; - } - else - { - vidskip = (double)title->rate / (double)title->rate_base + 0.5; - } - // If it's a BD, we can relax this a bit. Since seeks will - // at least get us to a recovery point. - if (data->bd || title->type == HB_FF_STREAM_TYPE) - vidskip = 2; - } for( j = 0; j < 10240 ; j++ ) { @@ -626,9 +607,6 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) hb_log( "Warning: Could not read data for preview %d, skipped", i + 1 ); goto skip_preview; } - int count = hb_stream_recovery_count( data->stream ); - if ( count ) - vidskip = count - 1; } else { @@ -646,15 +624,6 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) if( buf_es->id == title->video_id && vid_buf == NULL ) { vid_decoder->work( vid_decoder, &buf_es, &vid_buf ); - // we're dropping frames to get the video decoder in sync - // when the video stream doesn't contain IDR frames - while (vid_buf && --vidskip >= 0) - { - hb_buffer_t * next = vid_buf->next; - vid_buf->next = NULL; - hb_buffer_close( &vid_buf ); - vid_buf = next; - } } else if( ! AllAudioOK( title ) ) { |