summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-02-06 16:30:31 +0000
committerjstebbins <[email protected]>2010-02-06 16:30:31 +0000
commitb0a6491c0e2cffd2d01d2f9a2b83f3981932ff98 (patch)
tree8b1ded06d21b362e19dca4018a2ffa61f3ac5aa7 /libhb/stream.c
parent13b843cdca7bd875316d3bd8327d1c1575da8674 (diff)
use DTS generated by x264 when computing duration and offset in muxmp4
also fix an issue where ffmpeg generated negative PTS for initial frames of video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3097 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index b3479716c..07f07c792 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -1274,6 +1274,17 @@ int hb_stream_seek_chapter( hb_stream_t * stream, int chapter_num )
{
av_seek_frame( stream->ffmpeg_ic, -1, pos, 0);
}
+ else
+ {
+ // ffmpeg has a bug that causes the first PTS after
+ // av_find_stream_info() is called to be incorrect.
+ // av_find_stream_info is called whenever opening a file
+ // with ffmpeg. av_seek_frame clears the condition
+ // that causes the problem. since hb_stream_seek_chapter
+ // is called before we start reading, make sure
+ // we do a seek here.
+ av_seek_frame( stream->ffmpeg_ic, -1, 0LL, AVSEEK_FLAG_BACKWARD );
+ }
return 1;
}