From 8e4c10003acc5c909e3f8a463995ffd428a41a58 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sun, 11 Sep 2011 17:59:32 +0200 Subject: [PATCH] Set AV_PKT_FLAG_KEY based on nupplevideo header Based from lipbmpdemux/nupplevideo.h and from myth NuppelVideoRecorder.cpp --- libavformat/nuv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 20ca472673..2444a508c8 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -219,10 +219,9 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { ret = av_new_packet(pkt, copyhdrsize + size); if (ret < 0) return ret; - // HACK: we have no idea if it is a keyframe, - // but if we mark none seeking will not work at all. - pkt->flags |= AV_PKT_FLAG_KEY; + pkt->pos = pos; + pkt->flags |= hdr[2] == 0 ? AV_PKT_FLAG_KEY : 0; pkt->pts = AV_RL32(&hdr[4]); pkt->stream_index = ctx->v_id; memcpy(pkt->data, hdr, copyhdrsize);