From 60bb4d72efaf394627bf3c046caf1ac7e63ca94b Mon Sep 17 00:00:00 2001 From: Rodeo Date: Thu, 5 Dec 2013 17:26:46 +0000 Subject: sync: use "drop video to sync" fallback also when audio encoding fails or we do not get an output packet after 10 tries. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5918 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/sync.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libhb/sync.c b/libhb/sync.c index 0b38fa1f3..ac9c95885 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -1254,7 +1254,9 @@ static void InitAudio( hb_job_t * job, hb_sync_common_t * common, int i ) int ret = avcodec_encode_audio2( c, &pkt, &frame, &got_packet); if ( ret < 0 ) { - hb_log( "sync: avcodec_encode_audio failed" ); + hb_log("sync: track %d, avcodec_encode_audio() failed, dropping video to sync", + w->audio->config.out.track); + sync->drop_video_to_sync = 1; break; } @@ -1263,6 +1265,12 @@ static void InitAudio( hb_job_t * job, hb_sync_common_t * common, int i ) sync->silence_size = pkt.size; break; } + else if (ii + 1 == 10) + { + hb_log("sync: track %d, failed to get output packet, dropping video to sync", + w->audio->config.out.track); + sync->drop_video_to_sync = 1; + } } free( zeros ); hb_avcodec_close( c ); -- cgit v1.2.3