summaryrefslogtreecommitdiffstats
path: root/libhb/reader.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-04-24 22:31:47 +0000
committerjstebbins <[email protected]>2015-04-24 22:31:47 +0000
commitca6ad7f1c6f414758a99ea82bdfa9e64aae6aada (patch)
tree2c4e8ffd7f15d96b6ee96a032a1b076d7398b446 /libhb/reader.c
parent5eb127da904759380a7bd9d1d3f1b2d9137bdeba (diff)
p-to-p: fix seek to start pts source initial PTS != 0
When a file demuxed by libav does not start to time 0, our seek to the initial start pts tried to seek too far forward. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7124 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/reader.c')
-rw-r--r--libhb/reader.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/libhb/reader.c b/libhb/reader.c
index d5b37c38b..3e1c0c48b 100644
--- a/libhb/reader.c
+++ b/libhb/reader.c
@@ -455,19 +455,7 @@ void ReadLoop( void * _w )
}
else if ( r->stream && r->job->pts_to_start )
{
- int64_t pts_to_start = r->job->pts_to_start;
-
- // Find out what the first timestamp of the stream is
- // and then seek to the appropriate offset from it
- if ( ( buf = hb_stream_read( r->stream ) ) )
- {
- if (buf->s.start != AV_NOPTS_VALUE)
- {
- pts_to_start += buf->s.start;
- }
- }
-
- if ( hb_stream_seek_ts( r->stream, pts_to_start ) >= 0 )
+ if ( hb_stream_seek_ts( r->stream, r->job->pts_to_start ) >= 0 )
{
// Seek takes us to the nearest I-frame before the timestamp
// that we want. So we will retrieve the start time of the
@@ -475,12 +463,9 @@ void ReadLoop( void * _w )
// inspect the reset of the frames in sync.
r->start_found = 2;
r->duration -= r->job->pts_to_start;
- r->job->pts_to_start = pts_to_start;
- hb_buffer_close(&buf);
}
// hb_stream_seek_ts does nothing for TS streams and will return
- // an error. In this case, the current buf remains valid and
- // gets processed below.
+ // an error.
}
else if( r->stream )
{