diff options
author | van <[email protected]> | 2008-08-18 01:54:15 +0000 |
---|---|---|
committer | van <[email protected]> | 2008-08-18 01:54:15 +0000 |
commit | 1c4d7309b2924c283f9922adda37d93ad1beca88 (patch) | |
tree | 75d0f6df7f08453a5b7225df000b5356f05fd681 /libhb | |
parent | 6f5fe2aa5351c13739ea7dc9b9e357d96304c6fc (diff) |
- patch a reference picture leak in ffmpeg/libavcodec/mpegvideo.c that caused aborts on h264 transport stream encodes.
- patch the log level of some h264 decoder error messages so we don't fill our log with messages about stuff that's a very likely & not terribly significant.
- don't let hb.c set the ffmpeg av_log level to AV_LOG_DEBUG -- it fills the HB activity log with junk.
- add a count of the decoder errors to decavcodec's final report.
- when we don't have any chapter text (i.e., during a typical cli encode) just print the chapter number rather than empty quote marks.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1639 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/decavcodec.c | 30 | ||||
-rw-r--r-- | libhb/hb.c | 2 |
2 files changed, 22 insertions, 10 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index a945680e0..62eca6566 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -92,8 +92,9 @@ struct hb_work_private_s int64_t chap_time; // time of next chap mark (if new_chap != 0) int new_chap; int ignore_pts; // workaround M$ bugs - int nframes; - int ndrops; + uint32_t nframes; + uint32_t ndrops; + uint32_t decode_errors; double duration; // frame duration (for video) }; @@ -340,8 +341,16 @@ static int get_frame_buf( AVCodecContext *context, AVFrame *frame ) static void log_chapter( hb_work_private_t *pv, int chap_num, int64_t pts ) { hb_chapter_t *c = hb_list_item( pv->job->title->list_chapter, chap_num - 1 ); - hb_log( "%s: \"%s\" (%d) at frame %u time %lld", pv->context->codec->name, - c->title, chap_num, pv->nframes, pts ); + if ( c && c->title ) + { + hb_log( "%s: \"%s\" (%d) at frame %u time %lld", + pv->context->codec->name, c->title, chap_num, pv->nframes, pts ); + } + else + { + hb_log( "%s: Chapter %d at frame %u time %lld", + pv->context->codec->name, chap_num, pv->nframes, pts ); + } } static int decodeFrame( hb_work_private_t *pv, uint8_t *data, int size ) @@ -349,7 +358,10 @@ static int decodeFrame( hb_work_private_t *pv, uint8_t *data, int size ) int got_picture; AVFrame frame; - avcodec_decode_video( pv->context, &frame, &got_picture, data, size ); + if ( avcodec_decode_video( pv->context, &frame, &got_picture, data, size ) < 0 ) + { + ++pv->decode_errors; + } if( got_picture ) { // ffmpeg makes it hard to attach a pts to a frame. if the MPEG ES @@ -498,7 +510,8 @@ static int decavcodecvWork( hb_work_object_t * w, hb_buffer_t ** buf_in, decodeVideo( pv, in->data, in->size, pts, dts ); hb_list_add( pv->list, in ); *buf_out = link_buf_list( pv ); - hb_log( "%s done: %d frames", pv->context->codec->name, pv->nframes ); + hb_log( "%s done: %u frames, %u decoder errors", + pv->context->codec->name, pv->nframes, pv->decode_errors ); return HB_WORK_DONE; } @@ -710,8 +723,9 @@ static int decavcodecviWork( hb_work_object_t * w, hb_buffer_t ** buf_in, } hb_list_add( pv->list, in ); *buf_out = link_buf_list( pv ); - hb_log( "%s done: %d frames %d drops", pv->context->codec->name, - pv->nframes, pv->ndrops ); + hb_log( "%s done: %u frames, %u decoder errors, %u drops", + pv->context->codec->name, pv->nframes, pv->decode_errors, + pv->ndrops ); return HB_WORK_DONE; } diff --git a/libhb/hb.c b/libhb/hb.c index 0e0bddb3c..f73a2437e 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -73,7 +73,6 @@ hb_handle_t * hb_init_real( int verbose, int update_check ) if( verbose > HB_DEBUG_NONE ) { putenv( "HB_DEBUG=1" ); - av_log_set_level(AV_LOG_DEBUG); } /* Check for an update on the website if asked to */ @@ -153,7 +152,6 @@ hb_handle_t * hb_init_dl( int verbose, int update_check ) if( verbose > HB_DEBUG_NONE ) { putenv( "HB_DEBUG=1" ); - av_log_set_level(AV_LOG_DEBUG); } /* Check for an update on the website if asked to */ |