[Ffmpeg-cvslog] CVS: ffmpeg ffmpeg.c,1.345,1.346

Michael Niedermayer CVS michael
Sun Sep 11 10:24:38 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg
In directory mail:/var2/tmp/cvs-serv25361

Modified Files:
	ffmpeg.c 
Log Message:
do not rescale AV_NOPTS_VALUE


Index: ffmpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/ffmpeg.c,v
retrieving revision 1.345
retrieving revision 1.346
diff -u -d -r1.345 -r1.346
--- ffmpeg.c	4 Sep 2005 09:00:47 -0000	1.345
+++ ffmpeg.c	11 Sep 2005 08:24:36 -0000	1.346
@@ -583,7 +583,7 @@
             pkt.stream_index= ost->index;
             pkt.data= audio_out;
             pkt.size= ret;
-            if(enc->coded_frame)
+            if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
                 pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
             pkt.flags |= PKT_FLAG_KEY;
             av_interleaved_write_frame(s, &pkt);
@@ -627,7 +627,7 @@
         pkt.stream_index= ost->index;
         pkt.data= audio_out;
         pkt.size= ret;
-        if(enc->coded_frame)
+        if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
             pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
         pkt.flags |= PKT_FLAG_KEY;
         av_interleaved_write_frame(s, &pkt);
@@ -967,7 +967,7 @@
 	    enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
             pkt.data= (uint8_t *)final_picture;
             pkt.size=  sizeof(AVPicture);
-            if(dec->coded_frame)
+            if(dec->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
                 pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
             if(dec->coded_frame && dec->coded_frame->key_frame)
                 pkt.flags |= PKT_FLAG_KEY;
@@ -1007,7 +1007,7 @@
             if(ret>0){
                 pkt.data= bit_buffer;
                 pkt.size= ret;
-                if(enc->coded_frame)
+                if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
                     pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
 /*av_log(NULL, AV_LOG_DEBUG, "encoder -> %lld/%lld\n", 
    pkt.pts != AV_NOPTS_VALUE ? av_rescale(pkt.pts, enc->time_base.den, AV_TIME_BASE*(int64_t)enc->time_base.num) : -1,
@@ -1494,7 +1494,7 @@
                             break;
                         pkt.data= bit_buffer;
                         pkt.size= ret;
-                        if(enc->coded_frame)
+                        if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
                             pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
                         av_interleaved_write_frame(os, &pkt);
                     }





More information about the ffmpeg-cvslog mailing list