[MPlayer-cvslog] r21796 - in trunk/libmpdemux: demuxer.c demuxer.h

nicodvb subversion at mplayerhq.hu
Sun Dec 31 12:05:27 CET 2006


Author: nicodvb
Date: Sun Dec 31 12:05:26 2006
New Revision: 21796

Modified:
   trunk/libmpdemux/demuxer.c
   trunk/libmpdemux/demuxer.h

Log:
added stream_pts to demuxer_t and demux_packet_t to hold the time value reported by the stream layer

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Sun Dec 31 12:05:26 2006
@@ -184,6 +184,7 @@
   demuxer_t *d=malloc(sizeof(demuxer_t));
   memset(d,0,sizeof(demuxer_t));
   d->stream=stream;
+  d->stream_pts = MP_NOPTS_VALUE;
   d->movi_start=stream->start_pos;
   d->movi_end=stream->end_pos;
   d->seekable=1;
@@ -381,6 +382,7 @@
         ds->pts_bytes=0;
       }
       ds->pts_bytes+=p->len; // !!!
+      if(p->stream_pts != MP_NOPTS_VALUE) demux->stream_pts=p->stream_pts;
       ds->flags=p->flags;
       // unlink packet:
       ds->bytes-=p->len;
@@ -933,9 +935,9 @@
     if(flags & 1)  // absolute seek
       pts = 0.0f;
     else {
-      if(stream_control(demuxer->stream, STREAM_CTRL_GET_CURRENT_TIME, &tmp) == STREAM_UNSUPORTED)
+      if(demuxer->stream_pts == MP_NOPTS_VALUE)
         goto dmx_seek;
-      pts = tmp;
+      pts = demuxer->stream_pts;
     }
 
     if(flags & 2) {  // percent seek

Modified: trunk/libmpdemux/demuxer.h
==============================================================================
--- trunk/libmpdemux/demuxer.h	(original)
+++ trunk/libmpdemux/demuxer.h	Sun Dec 31 12:05:26 2006
@@ -85,6 +85,7 @@
 typedef struct demux_packet_st {
   int len;
   double pts;
+  double stream_pts;
   off_t pos;  // position in index (AVI) or file (MPG)
   unsigned char* buffer;
   int flags; // keyframe, etc
@@ -176,6 +177,7 @@
   off_t movi_start;
   off_t movi_end;
   stream_t *stream;
+  double stream_pts;       // current stream pts, if applicable (e.g. dvd)
   char *filename; ///< Needed by avs_check_file
   int synced;  // stream synced (used by mpeg)
   int type;    // demuxer type: mpeg PS, mpeg ES, avi, avi-ni, avi-nini, asf
@@ -210,6 +212,7 @@
   // still using 0 by default in case there is some code that uses 0 for both
   // unknown and a valid pts value
   dp->pts=correct_pts ? MP_NOPTS_VALUE : 0;
+  dp->stream_pts = MP_NOPTS_VALUE;
   dp->pos=0;
   dp->flags=0;
   dp->refcount=1;



More information about the MPlayer-cvslog mailing list