Set AV_PKT_FLAG_KEY based on nupplevideo header

Based from lipbmpdemux/nupplevideo.h and from myth NuppelVideoRecorder.cpp
This commit is contained in:
Joakim Plate 2011-09-11 17:59:32 +02:00
parent 7768f6b1b9
commit 8e4c10003a
1 changed files with 2 additions and 3 deletions

View File

@ -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);