diff options
author | jstebbins <[email protected]> | 2011-04-02 19:58:34 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-04-02 19:58:34 +0000 |
commit | c5493132981f650d13c03181d53da5e3fd205bcd (patch) | |
tree | 85845fd91828ab1f7b87814567f447564ada5872 /libhb | |
parent | 889409ab149f8d7b20be0dfb720359c80fb7471e (diff) |
Fix garbled previews from BD h.264 sources
Forome reason, frames that are tagged as recovery points in many BD h.264
streams do not result in complete frames when decoded. Pushing 2 extra
frames through the decoder seems to always fix this. This patch extends
something I was already doing when generating previews from a BD structure.
This just applies the same logic to ffmpeg streams that have h.264 video.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3895 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.h | 2 | ||||
-rw-r--r-- | libhb/reader.c | 3 | ||||
-rw-r--r-- | libhb/scan.c | 4 | ||||
-rw-r--r-- | libhb/stream.c | 5 |
4 files changed, 9 insertions, 5 deletions
diff --git a/libhb/common.h b/libhb/common.h index b8045234c..a3461e864 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -573,7 +573,7 @@ struct hb_metadata_s struct hb_title_s { - enum { HB_DVD_TYPE, HB_BD_TYPE, HB_STREAM_TYPE } type; + enum { HB_DVD_TYPE, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE } type; uint32_t reg_desc; char path[1024]; char name[1024]; diff --git a/libhb/reader.c b/libhb/reader.c index bd3758eea..d506719d4 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -236,7 +236,8 @@ static void ReaderFunc( void * _r ) if ( !( r->dvd = hb_dvd_init( r->title->path ) ) ) return; } - else if ( r->title->type == HB_STREAM_TYPE ) + else if ( r->title->type == HB_STREAM_TYPE || + r->title->type == HB_FF_STREAM_TYPE ) { if ( !( r->stream = hb_stream_open( r->title->path, r->title ) ) ) return; diff --git a/libhb/scan.c b/libhb/scan.c index bec45d373..7b563638a 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -555,8 +555,8 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title ) } // 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) - vidskip = 4; + if (data->bd || title->type == HB_FF_STREAM_TYPE) + vidskip = 2; } for( j = 0; j < 10240 ; j++ ) diff --git a/libhb/stream.c b/libhb/stream.c index 64fa6cba4..5b4d248d0 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -3271,7 +3271,7 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream ) // 'Barebones Title' hb_title_t *title = hb_title_init( stream->path, 0 ); - title->type = HB_STREAM_TYPE; + title->type = HB_FF_STREAM_TYPE; title->index = 1; // Copy part of the stream path to the title name @@ -3309,6 +3309,9 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream ) title->video_id = i; stream->ffmpeg_video_id = i; + if ( context->codec_id == CODEC_ID_H264 ) + title->flags |= HBTF_NO_IDR; + // We have to use the 'internal' avcodec decoder because // it needs to share the codec context from this video // stream. The parser internal to av_read_frame |