summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodeo <[email protected]>2014-02-07 15:16:24 +0000
committerRodeo <[email protected]>2014-02-07 15:16:24 +0000
commitd710c5a94605517233d8745fb8a2c379f2964cef (patch)
tree1daf50135a78de4325470ed702e02d6b6f95d9d4
parentf73402fbf0accd11b94a78e1cf077941718ef3d9 (diff)
QSV: work around an issue where two consecutive IDR frames cause Media SDK to use one more consecutive reference B-frame than accounted for by the initial PTS-DTS delay.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6016 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/enc_qsv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c
index e4d0dc04b..6a9a27c4e 100644
--- a/libhb/enc_qsv.c
+++ b/libhb/enc_qsv.c
@@ -1464,6 +1464,16 @@ int encqsvWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
((task->bs->TimeStamp -
task->bs->DecodeTimeStamp +
(duration / 2)) / duration));
+
+ // When forcing an IDR for a chapter right after another IDR
+ // selected by MSDK, we may end up with one more consecutive
+ // B-reference frame than the original delay accounts for;
+ // work around it by incrementing the delay in this case
+ if (pv->bfrm_workaround && job->chapter_markers &&
+ pv->bfrm_delay > 1)
+ {
+ pv->bfrm_delay++;
+ }
}
if (!pv->bfrm_workaround)