[FFmpeg-cvslog] cdg: Try to detect keyframes.

Michael Niedermayer git at videolan.org
Wed Oct 12 04:21:55 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 12 03:38:39 2011 +0200| [fe19e138cd0dfd786e80d7544789624d5cc86239] | committer: Michael Niedermayer

cdg: Try to detect keyframes.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/cdg.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/cdg.c b/libavformat/cdg.c
index 1f1442b..9bcc285 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;
 }
 



More information about the ffmpeg-cvslog mailing list