From e84807f7e044d08e9826007badc57c9d19508e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Thu, 27 Mar 2008 19:29:52 +0000 Subject: [PATCH] Set duration in correct timebase Set key-frame flag if packet contains a key frame --- ffmuxer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ffmuxer.c b/ffmuxer.c index cf07824b..9ca375de 100644 --- a/ffmuxer.c +++ b/ffmuxer.c @@ -370,8 +370,9 @@ tffm_record_packet(th_ffmuxer_t *tffm, th_pkt_t *pkt) avpkt.pts = av_rescale_q(pkt->pkt_pts, AV_TIME_BASE_Q, st->time_base); avpkt.data = buf; avpkt.size = bufsize; - avpkt.duration = pkt->pkt_duration; - + avpkt.duration = + av_rescale_q(pkt->pkt_duration, AV_TIME_BASE_Q, st->time_base); + avpkt.flags = pkt->pkt_frametype >= PKT_P_FRAME ? 0 : PKT_FLAG_KEY; r = av_interleaved_write_frame(fctx, &avpkt); break;