changeset 552:56a704ec417e libavformat

do not randomize unknown timestamps
author michael
date Thu, 07 Oct 2004 01:55:34 +0000
parents ef359bf133cc
children 9e80f7595694
files mpeg.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg.c	Wed Oct 06 22:29:30 2004 +0000
+++ b/mpeg.c	Thu Oct 07 01:55:34 2004 +0000
@@ -1029,13 +1029,13 @@
            and the first pack from the other stream, respectively, may also have
            been written before.
            So the real data starts at SCR 36000+3*1200. */
-        pts += 36000 + 3600;
-        dts += 36000 + 3600;
+        if(pts != AV_NOPTS_VALUE) pts += 36000 + 3600;
+        if(dts != AV_NOPTS_VALUE) dts += 36000 + 3600;
     }else{
-        pts += PRELOAD;
-        dts += PRELOAD;
+        if(pts != AV_NOPTS_VALUE) pts += PRELOAD;
+        if(dts != AV_NOPTS_VALUE) dts += PRELOAD;
     }
-//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d\n", dts/90000.0, pts/90000.0, pkt->flags, pkt->stream_index);
+//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/90000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE);
     *stream->next_packet=
     pkt_desc= av_mallocz(sizeof(PacketDesc));
     pkt_desc->pts= pts;