#include "libswscale/swscale.h"
#undef exit
-#undef fprintf
-#undef printf
-#undef snprintf
/* 5 seconds stream duration */
#define STREAM_DURATION 5.0
pkt.size= avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);
- pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
+ 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;
pkt.data= audio_outbuf;
AVPacket pkt;
av_init_packet(&pkt);
- pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
+ 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;
pkt.stream_index= st->index;