summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-10-20 06:19:02 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-10-20 06:19:02 +0000
commit99beb778cc6bb3502d58b16176af1e98b72f9f60 (patch)
tree18336a888d30f1c57c4d0926dc609eff668f3e9e /src
parentfafdc4ddc252c7d33f202f127b7f999069674e6d (diff)
downloadxine-lib-99beb778cc6bb3502d58b16176af1e98b72f9f60.tar.gz
xine-lib-99beb778cc6bb3502d58b16176af1e98b72f9f60.tar.bz2
Submitted by Rett Walters: -
Implement relative seeking and time display in mpeg2 transport streams. The time display might be off on some streams. CVS patchset: 5556 CVS date: 2003/10/20 06:19:02
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_ts.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index a361bc32b..e10da8208 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: demux_ts.c,v 1.90 2003/10/06 15:46:20 mroi Exp $
+ * $Id: demux_ts.c,v 1.91 2003/10/20 06:19:02 jcdutton Exp $
*
* Demultiplexer for MPEG2 Transport Streams.
*
@@ -771,6 +771,9 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts,
m->buf->pts = m->pts;
m->buf->decoder_info[0] = 1;
m->buf->extra_info->input_pos = this->input->get_current_pos(this->input);
+ if (this->rate)
+ m->buf->extra_info->input_time = (int)((int64_t)m->buf->extra_info->input_pos
+ * 1000 / (this->rate * 50));
m->fifo->put(m->fifo, m->buf);
m->buffered_bytes = 0;
m->buf = NULL; /* forget about buf -- not our responsibility anymore */
@@ -800,6 +803,9 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts,
m->buf->pts = m->pts;
m->buf->decoder_info[0] = 1;
m->buf->extra_info->input_pos = this->input->get_current_pos(this->input);
+ if (this->rate)
+ m->buf->extra_info->input_time = (int)((int64_t)m->buf->extra_info->input_pos
+ * 1000 / (this->rate * 50));
m->fifo->put(m->fifo, m->buf);
m->buffered_bytes = 0;
m->buf = m->fifo->buffer_pool_alloc(m->fifo);
@@ -1781,9 +1787,11 @@ 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 = start_time * this->rate * 50;
-
+ if ((!start_pos) && (start_time)) {
+ start_pos = start_time;
+ start_pos *= this->rate;
+ start_pos *= 50;
+ }
this->input->seek (this->input, start_pos, SEEK_SET);
}