[FFmpeg-cvslog] paf: properly flag video packets

Paul B Mahol git at videolan.org
Sun Jul 8 23:06:37 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Jul  8 20:35:34 2012 +0000| [26fa84105b637ef10904278b266863dcdc104c33] | committer: Paul B Mahol

paf: properly flag video packets

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavformat/paf.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/paf.c b/libavformat/paf.c
index 5261ecf..aeebaba 100644
--- a/libavformat/paf.c
+++ b/libavformat/paf.c
@@ -232,7 +232,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
     }
 
     size = p->video_size - p->frames_offset_table[p->current_frame];
-    if (size < 0)
+    if (size < 1)
         return AVERROR_INVALIDDATA;
 
     if (av_new_packet(pkt, size) < 0)
@@ -241,6 +241,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
     pkt->stream_index = 0;
     pkt->duration     = 1;
     memcpy(pkt->data, p->video_frame + p->frames_offset_table[p->current_frame], size);
+    if (pkt->data[0] & 0x20)
+        pkt->flags   |= AV_PKT_FLAG_KEY;
     p->current_frame++;
 
     return pkt->size;



More information about the ffmpeg-cvslog mailing list