From 720c9e8623e64466c419a48506822d527f149715 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Tue, 18 Oct 2011 15:35:19 +0300 Subject: demux_ts.c: Use input->seek_time() when available. --- src/demuxers/demux_ts.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 99c2074d0..98808ec62 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -2301,10 +2301,17 @@ static int demux_ts_seek (demux_plugin_t *this_gen, if (this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) { if ((!start_pos) && (start_time)) { - start_pos = (int64_t)start_time * this->rate / 1000; - } - this->input->seek (this->input, start_pos, SEEK_SET); + if (this->input->seek_time) { + this->input->seek_time(this->input, start_time, SEEK_SET); + } else { + start_pos = (int64_t)start_time * this->rate / 1000; + this->input->seek (this->input, start_pos, SEEK_SET); + } + + } else { + this->input->seek (this->input, start_pos, SEEK_SET); + } } this->send_newpts = 1; -- cgit v1.2.3