summaryrefslogtreecommitdiffstats
path: root/libhb/work.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-04-22 21:11:30 +0000
committerjstebbins <[email protected]>2015-04-22 21:11:30 +0000
commitc48e55d5563dc05aed1652a34bc5359376aed2a7 (patch)
treef693e6ec79680b9cbd6e6e0101ec110804ca9cd4 /libhb/work.c
parentd839ca1690e89704f2b4a8e7d5ab40f8b7cb6a83 (diff)
sync: fix frame p-to-p extra audio after end frame
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7119 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/work.c')
-rw-r--r--libhb/work.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/libhb/work.c b/libhb/work.c
index 582b2a5ef..3168e1fde 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -163,16 +163,22 @@ hb_work_object_t * hb_get_work( hb_handle_t *h, int id )
hb_work_object_t* hb_codec_decoder(hb_handle_t *h, int codec)
{
+ hb_work_object_t * w = NULL;
if (codec & HB_ACODEC_FF_MASK)
{
- return hb_get_work(h, WORK_DECAVCODEC);
+ w = hb_get_work(h, WORK_DECAVCODEC);
+ w->yield = 1; // decoders yield to keep sync fifos more even
}
switch (codec)
{
- case HB_ACODEC_LPCM: return hb_get_work(h, WORK_DECLPCM);
- default: break;
+ case HB_ACODEC_LPCM:
+ w = hb_get_work(h, WORK_DECLPCM);
+ w->yield = 1; // decoders yield to keep sync fifos more even
+ break;
+ default:
+ break;
}
- return NULL;
+ return w;
}
hb_work_object_t* hb_codec_encoder(hb_handle_t *h, int codec)
@@ -1228,6 +1234,7 @@ static void do_job(hb_job_t *job)
goto cleanup;
}
hb_list_add(job->list_work, (w = hb_get_work(job->h, title->video_codec)));
+ w->yield = 1; // decoders yield to keep sync fifos more even
w->codec_param = title->video_codec_param;
w->fifo_in = job->fifo_mpeg2;
w->fifo_out = job->fifo_raw;
@@ -1767,6 +1774,10 @@ static void work_loop( void * _w )
}
}
}
+ if (w->yield)
+ {
+ hb_yield();
+ }
}
if ( buf_out )
{