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

reimar subversion at mplayerhq.hu
Tue Feb 12 11:48:43 CET 2008


Author: reimar
Date: Tue Feb 12 11:48:42 2008
New Revision: 25988

Log:
Change to always use MP_NOPTS_VALUE (instead of sometimes 0) for unknown pts.
I did not see anything obvious that would break, it if it does it should be
fixed properly once and for all.


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

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Tue Feb 12 11:48:42 2008
@@ -425,7 +425,7 @@ int ds_fill_buffer(demux_stream_t *ds){
       ds->pos=p->pos;
       ds->dpos+=p->len; // !!!
       ++ds->pack_no;
-      if (p->pts != (correct_pts ? MP_NOPTS_VALUE : 0)) {
+      if (p->pts != MP_NOPTS_VALUE) {
         ds->pts=p->pts;
         ds->pts_bytes=0;
       }
@@ -580,9 +580,8 @@ int ds_get_packet_pts(demux_stream_t *ds
             return -1;
 	}
     }
-    // Should use MP_NOPTS_VALUE for "unknown pts" in the packets too
     // Return pts unless this read starts from the middle of a packet
-    if (!ds->buffer_pos && (correct_pts || ds->current->pts))
+    if (!ds->buffer_pos)
 	*pts = ds->current->pts;
     len=ds->buffer_size-ds->buffer_pos;
     *start = &ds->buffer[ds->buffer_pos];

Modified: trunk/libmpdemux/demuxer.h
==============================================================================
--- trunk/libmpdemux/demuxer.h	(original)
+++ trunk/libmpdemux/demuxer.h	Tue Feb 12 11:48:42 2008
@@ -228,9 +228,7 @@ static inline demux_packet_t* new_demux_
   demux_packet_t* dp=(demux_packet_t*)malloc(sizeof(demux_packet_t));
   dp->len=len;
   dp->next=NULL;
-  // 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->pts=MP_NOPTS_VALUE;
   dp->endpts=MP_NOPTS_VALUE;
   dp->stream_pts = MP_NOPTS_VALUE;
   dp->pos=0;



More information about the MPlayer-cvslog mailing list