# HG changeset patch # User reimar # Date 1202813322 0 # Node ID 7e4a2ab8b61cfd9ee0fcbaba8d85956aa2692911 # Parent eff9e1b2574384c1ac4db1d0a7d29974aaa906ce 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. diff -r eff9e1b25743 -r 7e4a2ab8b61c libmpdemux/demuxer.c --- a/libmpdemux/demuxer.c Mon Feb 11 22:03:34 2008 +0000 +++ b/libmpdemux/demuxer.c Tue Feb 12 10:48:42 2008 +0000 @@ -425,7 +425,7 @@ 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 @@ 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]; diff -r eff9e1b25743 -r 7e4a2ab8b61c libmpdemux/demuxer.h --- a/libmpdemux/demuxer.h Mon Feb 11 22:03:34 2008 +0000 +++ b/libmpdemux/demuxer.h Tue Feb 12 10:48:42 2008 +0000 @@ -228,9 +228,7 @@ 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;