[FFmpeg-cvslog] avformat/bink: recognize bink2 files

Peter Ross git at videolan.org
Thu Jan 2 12:24:56 CET 2014


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Thu Jan  2 19:34:45 2014 +1100| [7340718d1c457f233e50e3ff4b15c113523c3200] | committer: Michael Niedermayer

avformat/bink: recognize bink2 files

Support demuxing of audio streams in bink2 files.

Signed-off-by: Peter Ross <pross at xvid.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/bink.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavformat/bink.c b/libavformat/bink.c
index 95b615a..eb1e332 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -59,8 +59,10 @@ static int probe(AVProbeData *p)
 {
     const uint8_t *b = p->buf;
 
-    if ( b[0] == 'B' && b[1] == 'I' && b[2] == 'K' &&
-        (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i') &&
+    if (((b[0] == 'B' && b[1] == 'I' && b[2] == 'K' &&
+         (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i')) ||
+         (b[0] == 'K' && b[1] == 'B' && b[2] == '2' && /* Bink 2 */
+         (b[3] == 'a' || b[3] == 'd' || b[3] == 'f' || b[3] == 'g'))) &&
         AV_RL32(b+8) > 0 &&  // num_frames
         AV_RL32(b+20) > 0 && AV_RL32(b+20) <= BINK_MAX_WIDTH &&
         AV_RL32(b+24) > 0 && AV_RL32(b+24) <= BINK_MAX_HEIGHT &&
@@ -116,6 +118,12 @@ static int read_header(AVFormatContext *s)
 
     vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     vst->codec->codec_id   = AV_CODEC_ID_BINKVIDEO;
+
+    if ((vst->codec->codec_tag & 0xFFFFFF) == MKTAG('K', 'B', '2', 0)) {
+        av_log(s, AV_LOG_WARNING, "Bink 2 video is not implemented\n");
+        vst->codec->codec_id = AV_CODEC_ID_NONE;
+    }
+
     if (ff_get_extradata(vst->codec, pb, 4) < 0)
         return AVERROR(ENOMEM);
 



More information about the ffmpeg-cvslog mailing list