summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2008-01-22 17:19:43 +0000
committerjbrjake <[email protected]>2008-01-22 17:19:43 +0000
commit9f7c6f5bd3eb26e1bbaafa535aa7f2f600e4ab56 (patch)
tree9709dc42dd92691414d039273d9a5a696cdbdbb5 /libhb
parentff9b9751c6da20e44158347d9a3c7276a99d0a18 (diff)
Prevents VFR from leaving PTS gaps at dropped frames, so it works properly with the new sync and MP4 muxing code in r1223 and r1224 that passes through the source's time stamps.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1227 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/render.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libhb/render.c b/libhb/render.c
index c518f4146..4253a9237 100644
--- a/libhb/render.c
+++ b/libhb/render.c
@@ -237,17 +237,6 @@ int renderWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
/* Setup render buffer */
hb_buffer_t * buf_render = hb_buffer_init( 3 * job->width * job->height / 2 );
- /* Cache frame start and stop times, so we can renumber
- time stamps if dropping frames for VFR. */
- int i;
- for( i = 3; i >= 1; i-- )
- {
- pv->last_start[i] = pv->last_start[i-1];
- pv->last_stop[i] = pv->last_stop[i-1];
- }
- pv->last_start[0] = in->start;
- pv->last_stop[0] = in->stop;
-
/* Apply filters */
if( job->filters )
{
@@ -304,7 +293,21 @@ int renderWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
}
}
}
-
+
+ if( buf_tmp_in )
+ {
+ /* Cache frame start and stop times, so we can renumber
+ time stamps if dropping frames for VFR. */
+ int i;
+ for( i = 3; i >= 1; i-- )
+ {
+ pv->last_start[i] = pv->last_start[i-1];
+ pv->last_stop[i] = pv->last_stop[i-1];
+ }
+ pv->last_start[0] = in->start;
+ pv->last_stop[0] = in->stop;
+ }
+
/* Apply subtitles */
if( buf_tmp_in )
{
@@ -412,8 +415,9 @@ int renderWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
length frame. If it needs to be extended as well to
make up lost time, it'll be handled on the next
loop through the renderer. */
+ int temp_duration = pv->last_stop[2] - pv->last_start[2];
pv->last_start[2] = ivtc_buffer->stop;
- pv->last_stop[2] = ivtc_buffer->stop + 3003;
+ pv->last_stop[2] = ivtc_buffer->stop + temp_duration;
pv->frames_to_extend--;
pv->extended_frames++;