[FFmpeg-cvslog] Set AV_PKT_FLAG_KEY based on nupplevideo header

Joakim Plate git at videolan.org
Sun Sep 18 18:30:43 CEST 2011


ffmpeg | branch: master | Joakim Plate <elupus at ecce.se> | Sun Sep 11 17:59:32 2011 +0200| [8e4c10003acc5c909e3f8a463995ffd428a41a58] | committer: Joakim Plate

Set AV_PKT_FLAG_KEY based on nupplevideo header

Based from lipbmpdemux/nupplevideo.h and from myth NuppelVideoRecorder.cpp

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e4c10003acc5c909e3f8a463995ffd428a41a58
---

 libavformat/nuv.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 20ca472..2444a50 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);



More information about the ffmpeg-cvslog mailing list