提交 7b8fd298 编写于 作者: M Michael Niedermayer

examples/muxing: fix video pts

Fixes Ticket1801
Based on suggestion from AztecC
Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 5d2b8850
......@@ -382,9 +382,6 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
/* If size is zero, it means the image was buffered. */
if (got_output) {
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 |= AV_PKT_FLAG_KEY;
......@@ -509,7 +506,7 @@ int main(int argc, char **argv)
write_audio_frame(oc, audio_st);
} else {
write_video_frame(oc, video_st);
frame->pts++;
frame->pts += av_rescale_q(1, video_st->codec->time_base, video_st->time_base);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册