diff options
author | jstebbins <[email protected]> | 2011-09-14 16:03:52 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-09-14 16:03:52 +0000 |
commit | 3cdb1f293da7bb6e1f506c899ced038068aeeddf (patch) | |
tree | 53552ce38e0c8f23675cbf71f4dc68cc302315b7 /libhb/decavcodec.c | |
parent | ace57e1b754f84cad9603e7ed14aa9c6bb705461 (diff) |
Improve mpeg PS support
Adds support for MPEG-1 PS, HDDVD EVOB, and video codecs other
than mpeg1/2 in PS
Improves probing of unknown stream types by using Libav's probing
utilities
Use Libav to probe for dts profile in TS and PS files when profile is
unknown
Improves framerate detection (improved telecine detection)
Fixes preview generation for mpeg video that has only a single sequence
header
Patches Libav to handle VC-1 pulldown flags properly
Improve PS and TS stream log information
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4220 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r-- | libhb/decavcodec.c | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 4d62c0274..fcd3ce032 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -50,13 +50,13 @@ static int decavcodecaBSInfo( hb_work_object_t *, const hb_buffer_t *, hb_work_i hb_work_object_t hb_decavcodeca = { - WORK_DECAVCODEC, - "Audio decoder (libavcodec)", - decavcodecaInit, - decavcodecaWork, - decavcodecClose, - decavcodecaInfo, - decavcodecaBSInfo + .id = WORK_DECAVCODEC, + .name = "Audio decoder (libavcodec)", + .init = decavcodecaInit, + .work = decavcodecaWork, + .close = decavcodecClose, + .info = decavcodecaInfo, + .bsinfo = decavcodecaBSInfo }; #define HEAP_SIZE 8 @@ -482,6 +482,8 @@ static int decavcodecaBSInfo( hb_work_object_t *w, const hb_buffer_t *buf, buf = buf->next; } + info->profile = context->profile; + info->level = context->level; info->channel_map = &hb_smpte_chan_map; av_free( buffer ); @@ -1277,15 +1279,42 @@ static int decavcodecvBSInfo( hb_work_object_t *w, const hb_buffer_t *buf, return 0; } +static void decavcodecvFlush( hb_work_object_t *w ) +{ + hb_work_private_t *pv = w->private_data; + + if ( pv->context->codec ) + { + flushDelayQueue( pv ); + hb_buffer_t *buf = link_buf_list( pv ); + hb_buffer_close( &buf ); + if ( pv->title->opaque_priv == NULL ) + { + pv->video_codec_opened = 0; + hb_avcodec_close( pv->context ); + if ( pv->parser ) + { + av_parser_close(pv->parser); + } + pv->parser = av_parser_init( w->codec_param ); + } + else + { + avcodec_flush_buffers( pv->context ); + } + } +} + hb_work_object_t hb_decavcodecv = { - WORK_DECAVCODECV, - "Video decoder (libavcodec)", - decavcodecvInit, - decavcodecvWork, - decavcodecClose, - decavcodecvInfo, - decavcodecvBSInfo + .id = WORK_DECAVCODECV, + .name = "Video decoder (libavcodec)", + .init = decavcodecvInit, + .work = decavcodecvWork, + .close = decavcodecClose, + .flush = decavcodecvFlush, + .info = decavcodecvInfo, + .bsinfo = decavcodecvBSInfo }; static hb_buffer_t * downmixAudio( |