summaryrefslogtreecommitdiff
path: root/libavformat/cdg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-12 03:38:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-12 04:15:23 +0200
commitfe19e138cd0dfd786e80d7544789624d5cc86239 (patch)
tree97c3871b55d19f53ed5977671d7faded44cf09b1 /libavformat/cdg.c
parent045c5283c323a668fb0a989a3483d980fedd8f65 (diff)
downloadffmpeg-fe19e138cd0dfd786e80d7544789624d5cc86239.tar.gz
cdg: Try to detect keyframes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/cdg.c')
-rw-r--r--libavformat/cdg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/cdg.c b/libavformat/cdg.c
index 1f1442b100..9bcc285897 100644
--- a/libavformat/cdg.c
+++ b/libavformat/cdg.c
@@ -53,6 +53,10 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->stream_index = 0;
pkt->dts=pkt->pts= s->streams[0]->cur_dts;
+
+ if(ret>5 && (pkt->data[0]&0x3F) == 9 && (pkt->data[1]&0x3F)==1 && !(pkt->data[2+2+1] & 0x0F)){
+ pkt->flags = AV_PKT_FLAG_KEY;
+ }
return ret;
}