[FFmpeg-cvslog] r11002 - in trunk/libavformat: oggdec.c oggdec.h oggparseogm.c oggparsetheora.c
mru
subversion
Sun Nov 11 22:56:19 CET 2007
Author: mru
Date: Sun Nov 11 22:56:18 2007
New Revision: 11002
Log:
set PKT_FLAG_KEY for Theora and OGM streams
Modified:
trunk/libavformat/oggdec.c
trunk/libavformat/oggdec.h
trunk/libavformat/oggparseogm.c
trunk/libavformat/oggparsetheora.c
Modified: trunk/libavformat/oggdec.c
==============================================================================
--- trunk/libavformat/oggdec.c (original)
+++ trunk/libavformat/oggdec.c Sun Nov 11 22:56:18 2007
@@ -377,6 +377,7 @@ ogg_packet (AVFormatContext * s, int *st
}
if (os->header > -1 && os->seq > os->header){
+ os->pflags = 0;
if (os->codec && os->codec->packet)
os->codec->packet (s, idx);
if (str)
@@ -525,6 +526,8 @@ ogg_read_packet (AVFormatContext * s, AV
os->lastgp = -1;
}
+ pkt->flags = os->pflags;
+
return psize;
}
Modified: trunk/libavformat/oggdec.h
==============================================================================
--- trunk/libavformat/oggdec.h (original)
+++ trunk/libavformat/oggdec.h Sun Nov 11 22:56:18 2007
@@ -42,6 +42,7 @@ typedef struct ogg_stream {
unsigned int bufpos;
unsigned int pstart;
unsigned int psize;
+ unsigned int pflags;
uint32_t serial;
uint32_t seq;
uint64_t granule, lastgp;
Modified: trunk/libavformat/oggparseogm.c
==============================================================================
--- trunk/libavformat/oggparseogm.c (original)
+++ trunk/libavformat/oggparseogm.c Sun Nov 11 22:56:18 2007
@@ -134,6 +134,9 @@ ogm_packet(AVFormatContext *s, int idx)
uint8_t *p = os->buf + os->pstart;
int lb;
+ if(*p & 8)
+ os->pflags |= PKT_FLAG_KEY;
+
lb = ((*p & 2) << 1) | ((*p >> 6) & 3);
os->pstart += lb + 1;
os->psize -= lb + 1;
Modified: trunk/libavformat/oggparsetheora.c
==============================================================================
--- trunk/libavformat/oggparsetheora.c (original)
+++ trunk/libavformat/oggparsetheora.c Sun Nov 11 22:56:18 2007
@@ -124,6 +124,9 @@ theora_gptopts(AVFormatContext *ctx, int
uint64_t iframe = gp >> thp->gpshift;
uint64_t pframe = gp & thp->gpmask;
+ if(!pframe)
+ os->pflags |= PKT_FLAG_KEY;
+
return iframe + pframe;
}
More information about the ffmpeg-cvslog
mailing list