]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Do not rescale AV_NOPTS_VALUE in output_example.c
authorlucabe <lucabe@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 23 Jul 2008 10:56:56 +0000 (10:56 +0000)
committerlucabe <lucabe@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 23 Jul 2008 10:56:56 +0000 (10:56 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14345 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

output_example.c

index 515a172661103956825b9597e6aed1bd9fdf6565..0b0b67ffcf488c062176d99a6aa76aecdd452a8a 100644 (file)
@@ -156,6 +156,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
 
     pkt.size= avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);
 
+    if (c->coded_frame->pts != AV_NOPTS_VALUE)
     pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
     pkt.flags |= PKT_FLAG_KEY;
     pkt.stream_index= st->index;
@@ -380,6 +381,7 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
             AVPacket pkt;
             av_init_packet(&pkt);
 
+            if (c->coded_frame->pts != AV_NOPTS_VALUE)
             pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
             if(c->coded_frame->key_frame)
                 pkt.flags |= PKT_FLAG_KEY;