summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/demuxers/demux_ts.c13
1 files changed, 10 insertions, 3 deletions
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;