summaryrefslogtreecommitdiffstats
path: root/libhb/reader.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-03-11 13:44:24 -0700
committerJohn Stebbins <[email protected]>2016-03-11 13:44:24 -0700
commit97f73f55ad7e82b84c32deb6e31bac3324965822 (patch)
treefb835976098437681747e760131972d8255a44dc /libhb/reader.c
parent1c22bd3a3c09b6fe9b8bc1f796498a2f7d56e9f5 (diff)
reader: fix p-to-p seconds for non-seekable streams
This broke when sync was reworked. Sync now expects job->pts_to_start to be relative to the first frame that it sees.
Diffstat (limited to 'libhb/reader.c')
-rw-r--r--libhb/reader.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/libhb/reader.c b/libhb/reader.c
index 78a302d7e..cc9836290 100644
--- a/libhb/reader.c
+++ b/libhb/reader.c
@@ -733,7 +733,11 @@ static int reader_work( hb_work_object_t * w, hb_buffer_t ** buf_in,
if (!r->start_found && start >= r->pts_to_start)
{
// pts_to_start point found
- r->start_found = 1;
+ // Note that this code path only gets executed for
+ // medai where we have not performed an initial seek
+ // to get close to the start time. So the 'start' time
+ // is the time since the first frame.
+
if (r->stream)
{
// libav multi-threaded decoders can get into
@@ -744,6 +748,21 @@ static int reader_work( hb_work_object_t * w, hb_buffer_t ** buf_in,
hb_buffer_close( &buf );
continue;
}
+ r->start_found = 1;
+ // sync.c also pays attention to job->pts_to_start
+ // It eats up the 10 second slack that we build in
+ // to the start time here in reader (so that video
+ // decode is clean at the start time).
+ // sync.c expects pts_to_start to be relative to the
+ // first timestamp it sees.
+ if (r->job->pts_to_start > start)
+ {
+ r->job->pts_to_start -= start;
+ }
+ else
+ {
+ r->job->pts_to_start = 0;
+ }
}
// This log is handy when you need to debug timing problems
//hb_log("id %x scr_offset %"PRId64