Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbnnm <bananaman255@gmail.com>2017-08-18 20:45:16 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-20 12:33:51 +0300
commite7053f3316f53fc31d25384e3b6c89c96f8a5b20 (patch)
tree7cb00476037770e330f5e949534b7661099657a4 /libavformat/bink.c
parente7b9d136a1ba2d048b1a17df5778e426b825676d (diff)
lavf/bink: fix latest header and add all existing revisions
KB2 'i' found in Life is Strange (Xbox 360), rest verified against binkconv.exe Signed-off-by: bnnm <bananaman255@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/bink.c')
-rw-r--r--libavformat/bink.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 20dba677db..8a05082fcd 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -65,10 +65,12 @@ static int probe(AVProbeData *p)
int smush = AV_RN32(p->buf) == AV_RN32("SMUS");
do {
- 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' && /* Bink 1 */
+ (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i' ||
+ b[3] == 'k')) ||
(b[0] == 'K' && b[1] == 'B' && b[2] == '2' && /* Bink 2 */
- (b[3] == 'a' || b[3] == 'd' || b[3] == 'f' || b[3] == 'g'))) &&
+ (b[3] == 'a' || b[3] == 'd' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' ||
+ b[3] == 'i' || b[3] == 'j' || b[3] == 'k'))) &&
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 &&
@@ -159,7 +161,14 @@ static int read_header(AVFormatContext *s)
}
if (bink->num_audio_tracks) {
- avio_skip(pb, 4 * bink->num_audio_tracks);
+ uint32_t signature = (vst->codecpar->codec_tag & 0xFFFFFF);
+ uint8_t revision = ((vst->codecpar->codec_tag >> 24) % 0xFF);
+
+ if ((signature == AV_RL32("BIK") && (revision == 0x6b)) || /* k */
+ (signature == AV_RL32("KB2") && (revision == 0x69 || revision == 0x6a || revision == 0x6b))) /* i,j,k */
+ avio_skip(pb, 4); /* unknown new field */
+
+ avio_skip(pb, 4 * bink->num_audio_tracks); /* max decoded size */
for (i = 0; i < bink->num_audio_tracks; i++) {
ast = avformat_new_stream(s, NULL);