annotate bink.c @ 5659:d76ffa7128d4 libavformat

Strings in extended content header are UTF16, so terminating NULLs are 2 bytes long, not 1. Patch by Anton Khirnov, wyskas gmail
author cehoyos
date Mon, 15 Feb 2010 21:19:40 +0000
parents 9a624037cf06
children bbbedc311b93
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5614
d76904a638df Bink demuxer
pross
parents:
diff changeset
1 /*
d76904a638df Bink demuxer
pross
parents:
diff changeset
2 * Bink demuxer
d76904a638df Bink demuxer
pross
parents:
diff changeset
3 * Copyright (c) 2008-2010 Peter Ross (pross@xvid.org)
d76904a638df Bink demuxer
pross
parents:
diff changeset
4 * Copyright (c) 2009 Daniel Verkamp (daniel@drv.nu)
d76904a638df Bink demuxer
pross
parents:
diff changeset
5 *
d76904a638df Bink demuxer
pross
parents:
diff changeset
6 * This file is part of FFmpeg.
d76904a638df Bink demuxer
pross
parents:
diff changeset
7 *
d76904a638df Bink demuxer
pross
parents:
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
d76904a638df Bink demuxer
pross
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
d76904a638df Bink demuxer
pross
parents:
diff changeset
10 * License as published by the Free Software Foundation; either
d76904a638df Bink demuxer
pross
parents:
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
d76904a638df Bink demuxer
pross
parents:
diff changeset
12 *
d76904a638df Bink demuxer
pross
parents:
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
d76904a638df Bink demuxer
pross
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d76904a638df Bink demuxer
pross
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d76904a638df Bink demuxer
pross
parents:
diff changeset
16 * Lesser General Public License for more details.
d76904a638df Bink demuxer
pross
parents:
diff changeset
17 *
d76904a638df Bink demuxer
pross
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
d76904a638df Bink demuxer
pross
parents:
diff changeset
19 * License along with FFmpeg; if not, write to the Free Software
d76904a638df Bink demuxer
pross
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
d76904a638df Bink demuxer
pross
parents:
diff changeset
21 */
d76904a638df Bink demuxer
pross
parents:
diff changeset
22
d76904a638df Bink demuxer
pross
parents:
diff changeset
23 /**
d76904a638df Bink demuxer
pross
parents:
diff changeset
24 * @file libavformat/bink.c
d76904a638df Bink demuxer
pross
parents:
diff changeset
25 * Bink demuxer
d76904a638df Bink demuxer
pross
parents:
diff changeset
26 *
d76904a638df Bink demuxer
pross
parents:
diff changeset
27 * Technical details here:
d76904a638df Bink demuxer
pross
parents:
diff changeset
28 * http://wiki.multimedia.cx/index.php?title=Bink_Container
d76904a638df Bink demuxer
pross
parents:
diff changeset
29 */
d76904a638df Bink demuxer
pross
parents:
diff changeset
30
d76904a638df Bink demuxer
pross
parents:
diff changeset
31 #include "libavutil/intreadwrite.h"
d76904a638df Bink demuxer
pross
parents:
diff changeset
32 #include "avformat.h"
d76904a638df Bink demuxer
pross
parents:
diff changeset
33
d76904a638df Bink demuxer
pross
parents:
diff changeset
34 enum BinkAudFlags {
d76904a638df Bink demuxer
pross
parents:
diff changeset
35 BINK_AUD_16BITS = 0x4000, ///< prefer 16-bit output
d76904a638df Bink demuxer
pross
parents:
diff changeset
36 BINK_AUD_STEREO = 0x2000,
d76904a638df Bink demuxer
pross
parents:
diff changeset
37 BINK_AUD_USEDCT = 0x1000,
d76904a638df Bink demuxer
pross
parents:
diff changeset
38 };
d76904a638df Bink demuxer
pross
parents:
diff changeset
39
d76904a638df Bink demuxer
pross
parents:
diff changeset
40 #define BINK_EXTRADATA_SIZE 1
d76904a638df Bink demuxer
pross
parents:
diff changeset
41 #define BINK_MAX_AUDIO_TRACKS 256
d76904a638df Bink demuxer
pross
parents:
diff changeset
42 #define BINK_MAX_WIDTH 7680
d76904a638df Bink demuxer
pross
parents:
diff changeset
43 #define BINK_MAX_HEIGHT 4800
d76904a638df Bink demuxer
pross
parents:
diff changeset
44
d76904a638df Bink demuxer
pross
parents:
diff changeset
45 typedef struct {
d76904a638df Bink demuxer
pross
parents:
diff changeset
46 uint32_t file_size;
d76904a638df Bink demuxer
pross
parents:
diff changeset
47 uint32_t total_frames;
d76904a638df Bink demuxer
pross
parents:
diff changeset
48
d76904a638df Bink demuxer
pross
parents:
diff changeset
49 uint32_t num_audio_tracks;
d76904a638df Bink demuxer
pross
parents:
diff changeset
50 int current_track; ///< audio track to return in next packet
d76904a638df Bink demuxer
pross
parents:
diff changeset
51 int64_t video_pts;
d76904a638df Bink demuxer
pross
parents:
diff changeset
52 int64_t audio_pts[BINK_MAX_AUDIO_TRACKS];
d76904a638df Bink demuxer
pross
parents:
diff changeset
53
d76904a638df Bink demuxer
pross
parents:
diff changeset
54 uint32_t remain_packet_size;
d76904a638df Bink demuxer
pross
parents:
diff changeset
55 } BinkDemuxContext;
d76904a638df Bink demuxer
pross
parents:
diff changeset
56
d76904a638df Bink demuxer
pross
parents:
diff changeset
57 static int probe(AVProbeData *p)
d76904a638df Bink demuxer
pross
parents:
diff changeset
58 {
d76904a638df Bink demuxer
pross
parents:
diff changeset
59 const uint8_t *b = p->buf;
d76904a638df Bink demuxer
pross
parents:
diff changeset
60
d76904a638df Bink demuxer
pross
parents:
diff changeset
61 if ( b[0] == 'B' && b[1] == 'I' && b[2] == 'K' &&
d76904a638df Bink demuxer
pross
parents:
diff changeset
62 (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i') &&
d76904a638df Bink demuxer
pross
parents:
diff changeset
63 AV_RL32(b+8) > 0 && // num_frames
d76904a638df Bink demuxer
pross
parents:
diff changeset
64 AV_RL32(b+20) > 0 && AV_RL32(b+20) <= BINK_MAX_WIDTH &&
d76904a638df Bink demuxer
pross
parents:
diff changeset
65 AV_RL32(b+24) > 0 && AV_RL32(b+24) <= BINK_MAX_HEIGHT &&
d76904a638df Bink demuxer
pross
parents:
diff changeset
66 AV_RL32(b+28) > 0 && AV_RL32(b+32) > 0) // fps num,den
d76904a638df Bink demuxer
pross
parents:
diff changeset
67 return AVPROBE_SCORE_MAX;
d76904a638df Bink demuxer
pross
parents:
diff changeset
68 return 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
69 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
70
d76904a638df Bink demuxer
pross
parents:
diff changeset
71 static int read_header(AVFormatContext *s, AVFormatParameters *ap)
d76904a638df Bink demuxer
pross
parents:
diff changeset
72 {
d76904a638df Bink demuxer
pross
parents:
diff changeset
73 BinkDemuxContext *bink = s->priv_data;
d76904a638df Bink demuxer
pross
parents:
diff changeset
74 ByteIOContext *pb = s->pb;
d76904a638df Bink demuxer
pross
parents:
diff changeset
75 uint32_t fps_num, fps_den;
d76904a638df Bink demuxer
pross
parents:
diff changeset
76 AVStream *vst, *ast;
d76904a638df Bink demuxer
pross
parents:
diff changeset
77 unsigned int i;
d76904a638df Bink demuxer
pross
parents:
diff changeset
78 uint32_t pos, prev_pos;
d76904a638df Bink demuxer
pross
parents:
diff changeset
79 uint16_t flags;
d76904a638df Bink demuxer
pross
parents:
diff changeset
80 int keyframe;
d76904a638df Bink demuxer
pross
parents:
diff changeset
81
d76904a638df Bink demuxer
pross
parents:
diff changeset
82 vst = av_new_stream(s, 0);
d76904a638df Bink demuxer
pross
parents:
diff changeset
83 if (!vst)
d76904a638df Bink demuxer
pross
parents:
diff changeset
84 return AVERROR(ENOMEM);
d76904a638df Bink demuxer
pross
parents:
diff changeset
85
d76904a638df Bink demuxer
pross
parents:
diff changeset
86 vst->codec->codec_tag = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
87
d76904a638df Bink demuxer
pross
parents:
diff changeset
88 bink->file_size = get_le32(pb) + 8;
d76904a638df Bink demuxer
pross
parents:
diff changeset
89 bink->total_frames = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
90
d76904a638df Bink demuxer
pross
parents:
diff changeset
91 if (bink->total_frames > 1000000) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
92 av_log(s, AV_LOG_ERROR, "invalid header: more than 1000000 frames\n");
d76904a638df Bink demuxer
pross
parents:
diff changeset
93 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
94 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
95
d76904a638df Bink demuxer
pross
parents:
diff changeset
96 if (get_le32(pb) > bink->file_size) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
97 av_log(s, AV_LOG_ERROR,
d76904a638df Bink demuxer
pross
parents:
diff changeset
98 "invalid header: largest frame size greater than file size\n");
d76904a638df Bink demuxer
pross
parents:
diff changeset
99 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
100 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
101
d76904a638df Bink demuxer
pross
parents:
diff changeset
102 url_fskip(pb, 4);
d76904a638df Bink demuxer
pross
parents:
diff changeset
103
d76904a638df Bink demuxer
pross
parents:
diff changeset
104 vst->codec->width = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
105 vst->codec->height = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
106
d76904a638df Bink demuxer
pross
parents:
diff changeset
107 fps_num = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
108 fps_den = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
109 if (fps_num == 0 || fps_den == 0) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
110 av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den);
d76904a638df Bink demuxer
pross
parents:
diff changeset
111 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
112 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
113 av_set_pts_info(vst, 64, fps_den, fps_num);
d76904a638df Bink demuxer
pross
parents:
diff changeset
114
d76904a638df Bink demuxer
pross
parents:
diff changeset
115 url_fskip(pb, 4);
d76904a638df Bink demuxer
pross
parents:
diff changeset
116
d76904a638df Bink demuxer
pross
parents:
diff changeset
117 vst->codec->codec_type = CODEC_TYPE_VIDEO;
5616
9a624037cf06 Bink video codec id is there, demuxer can use it
kostya
parents: 5614
diff changeset
118 vst->codec->codec_id = CODEC_ID_BINKVIDEO;
5614
d76904a638df Bink demuxer
pross
parents:
diff changeset
119 bink->num_audio_tracks = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
120
d76904a638df Bink demuxer
pross
parents:
diff changeset
121 if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
122 av_log(s, AV_LOG_ERROR,
d76904a638df Bink demuxer
pross
parents:
diff changeset
123 "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n",
d76904a638df Bink demuxer
pross
parents:
diff changeset
124 bink->num_audio_tracks);
d76904a638df Bink demuxer
pross
parents:
diff changeset
125 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
126 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
127
d76904a638df Bink demuxer
pross
parents:
diff changeset
128 if (bink->num_audio_tracks) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
129 url_fskip(pb, 4 * bink->num_audio_tracks);
d76904a638df Bink demuxer
pross
parents:
diff changeset
130
d76904a638df Bink demuxer
pross
parents:
diff changeset
131 for (i = 0; i < bink->num_audio_tracks; i++) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
132 ast = av_new_stream(s, 1);
d76904a638df Bink demuxer
pross
parents:
diff changeset
133 if (!ast)
d76904a638df Bink demuxer
pross
parents:
diff changeset
134 return AVERROR(ENOMEM);
d76904a638df Bink demuxer
pross
parents:
diff changeset
135 ast->codec->codec_type = CODEC_TYPE_AUDIO;
d76904a638df Bink demuxer
pross
parents:
diff changeset
136 ast->codec->codec_tag = 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
137 ast->codec->sample_rate = get_le16(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
138 av_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
d76904a638df Bink demuxer
pross
parents:
diff changeset
139 flags = get_le16(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
140 ast->codec->codec_id = flags & BINK_AUD_USEDCT ?
d76904a638df Bink demuxer
pross
parents:
diff changeset
141 CODEC_ID_BINKAUDIO_DCT : CODEC_ID_BINKAUDIO_RDFT;
d76904a638df Bink demuxer
pross
parents:
diff changeset
142 ast->codec->channels = flags & BINK_AUD_STEREO ? 2 : 1;
d76904a638df Bink demuxer
pross
parents:
diff changeset
143 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
144
d76904a638df Bink demuxer
pross
parents:
diff changeset
145 url_fskip(pb, 4 * bink->num_audio_tracks);
d76904a638df Bink demuxer
pross
parents:
diff changeset
146 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
147
d76904a638df Bink demuxer
pross
parents:
diff changeset
148 /* frame index table */
d76904a638df Bink demuxer
pross
parents:
diff changeset
149 pos = get_le32(pb) & ~1;
d76904a638df Bink demuxer
pross
parents:
diff changeset
150 for (i = 0; i < bink->total_frames; i++) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
151 prev_pos = pos;
d76904a638df Bink demuxer
pross
parents:
diff changeset
152 if (i == bink->total_frames - 1) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
153 pos = bink->file_size;
d76904a638df Bink demuxer
pross
parents:
diff changeset
154 keyframe = 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
155 } else {
d76904a638df Bink demuxer
pross
parents:
diff changeset
156 pos = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
157 keyframe = pos & 1;
d76904a638df Bink demuxer
pross
parents:
diff changeset
158 pos &= ~1;
d76904a638df Bink demuxer
pross
parents:
diff changeset
159 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
160 if (pos <= prev_pos) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
161 av_log(s, AV_LOG_ERROR, "invalid frame index table\n");
d76904a638df Bink demuxer
pross
parents:
diff changeset
162 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
163 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
164 av_add_index_entry(vst, pos, i, pos - prev_pos, 0,
d76904a638df Bink demuxer
pross
parents:
diff changeset
165 keyframe ? AVINDEX_KEYFRAME : 0);
d76904a638df Bink demuxer
pross
parents:
diff changeset
166 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
167
d76904a638df Bink demuxer
pross
parents:
diff changeset
168 url_fskip(pb, 4);
d76904a638df Bink demuxer
pross
parents:
diff changeset
169
d76904a638df Bink demuxer
pross
parents:
diff changeset
170 bink->current_track = -1;
d76904a638df Bink demuxer
pross
parents:
diff changeset
171 return 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
172 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
173
d76904a638df Bink demuxer
pross
parents:
diff changeset
174 static int read_packet(AVFormatContext *s, AVPacket *pkt)
d76904a638df Bink demuxer
pross
parents:
diff changeset
175 {
d76904a638df Bink demuxer
pross
parents:
diff changeset
176 BinkDemuxContext *bink = s->priv_data;
d76904a638df Bink demuxer
pross
parents:
diff changeset
177 ByteIOContext *pb = s->pb;
d76904a638df Bink demuxer
pross
parents:
diff changeset
178 int ret;
d76904a638df Bink demuxer
pross
parents:
diff changeset
179
d76904a638df Bink demuxer
pross
parents:
diff changeset
180 if (bink->current_track < 0) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
181 int index_entry;
d76904a638df Bink demuxer
pross
parents:
diff changeset
182 AVStream *st = s->streams[0]; // stream 0 is video stream with index
d76904a638df Bink demuxer
pross
parents:
diff changeset
183
d76904a638df Bink demuxer
pross
parents:
diff changeset
184 if (bink->video_pts >= bink->total_frames)
d76904a638df Bink demuxer
pross
parents:
diff changeset
185 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
186
d76904a638df Bink demuxer
pross
parents:
diff changeset
187 index_entry = av_index_search_timestamp(st, bink->video_pts,
d76904a638df Bink demuxer
pross
parents:
diff changeset
188 AVSEEK_FLAG_ANY);
d76904a638df Bink demuxer
pross
parents:
diff changeset
189 if (index_entry < 0) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
190 av_log(s, AV_LOG_ERROR,
d76904a638df Bink demuxer
pross
parents:
diff changeset
191 "could not find index entry for frame %"PRId64"\n",
d76904a638df Bink demuxer
pross
parents:
diff changeset
192 bink->video_pts);
d76904a638df Bink demuxer
pross
parents:
diff changeset
193 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
194 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
195
d76904a638df Bink demuxer
pross
parents:
diff changeset
196 bink->remain_packet_size = st->index_entries[index_entry].size;
d76904a638df Bink demuxer
pross
parents:
diff changeset
197 bink->current_track = 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
198 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
199
d76904a638df Bink demuxer
pross
parents:
diff changeset
200 if (bink->current_track < bink->num_audio_tracks) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
201 uint32_t audio_size = get_le32(pb);
d76904a638df Bink demuxer
pross
parents:
diff changeset
202 if (audio_size > bink->remain_packet_size - 4) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
203 av_log(s, AV_LOG_ERROR,
d76904a638df Bink demuxer
pross
parents:
diff changeset
204 "frame %"PRId64": audio size in header (%u) > size of packet left (%u)\n",
d76904a638df Bink demuxer
pross
parents:
diff changeset
205 bink->video_pts, audio_size, bink->remain_packet_size);
d76904a638df Bink demuxer
pross
parents:
diff changeset
206 return AVERROR(EIO);
d76904a638df Bink demuxer
pross
parents:
diff changeset
207 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
208 bink->remain_packet_size -= 4 + audio_size;
d76904a638df Bink demuxer
pross
parents:
diff changeset
209 bink->current_track++;
d76904a638df Bink demuxer
pross
parents:
diff changeset
210 if (audio_size > 0) {
d76904a638df Bink demuxer
pross
parents:
diff changeset
211 /* Each audio packet reports the number of decompressed samples
d76904a638df Bink demuxer
pross
parents:
diff changeset
212 (in bytes). We use this value to calcuate the audio PTS */
d76904a638df Bink demuxer
pross
parents:
diff changeset
213 int reported_size = get_le32(pb) / (2 * s->streams[bink->current_track]->codec->channels);
d76904a638df Bink demuxer
pross
parents:
diff changeset
214 url_fseek(pb, -4, SEEK_CUR);
d76904a638df Bink demuxer
pross
parents:
diff changeset
215
d76904a638df Bink demuxer
pross
parents:
diff changeset
216 /* get one audio packet per track */
d76904a638df Bink demuxer
pross
parents:
diff changeset
217 if ((ret = av_get_packet(pb, pkt, audio_size))
d76904a638df Bink demuxer
pross
parents:
diff changeset
218 != audio_size)
d76904a638df Bink demuxer
pross
parents:
diff changeset
219 return ret;
d76904a638df Bink demuxer
pross
parents:
diff changeset
220 pkt->stream_index = bink->current_track;
d76904a638df Bink demuxer
pross
parents:
diff changeset
221 pkt->pts = bink->audio_pts[bink->current_track - 1] += reported_size;
d76904a638df Bink demuxer
pross
parents:
diff changeset
222 return 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
223 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
224 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
225
d76904a638df Bink demuxer
pross
parents:
diff changeset
226 /* get video packet */
d76904a638df Bink demuxer
pross
parents:
diff changeset
227 if ((ret = av_get_packet(pb, pkt, bink->remain_packet_size))
d76904a638df Bink demuxer
pross
parents:
diff changeset
228 != bink->remain_packet_size)
d76904a638df Bink demuxer
pross
parents:
diff changeset
229 return ret;
d76904a638df Bink demuxer
pross
parents:
diff changeset
230 pkt->stream_index = 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
231 pkt->pts = bink->video_pts++;
d76904a638df Bink demuxer
pross
parents:
diff changeset
232 pkt->flags |= PKT_FLAG_KEY;
d76904a638df Bink demuxer
pross
parents:
diff changeset
233
d76904a638df Bink demuxer
pross
parents:
diff changeset
234 /* -1 instructs the next call to read_packet() to read the next frame */
d76904a638df Bink demuxer
pross
parents:
diff changeset
235 bink->current_track = -1;
d76904a638df Bink demuxer
pross
parents:
diff changeset
236
d76904a638df Bink demuxer
pross
parents:
diff changeset
237 return 0;
d76904a638df Bink demuxer
pross
parents:
diff changeset
238 }
d76904a638df Bink demuxer
pross
parents:
diff changeset
239
d76904a638df Bink demuxer
pross
parents:
diff changeset
240 AVInputFormat bink_demuxer = {
d76904a638df Bink demuxer
pross
parents:
diff changeset
241 "bink",
d76904a638df Bink demuxer
pross
parents:
diff changeset
242 NULL_IF_CONFIG_SMALL("Bink"),
d76904a638df Bink demuxer
pross
parents:
diff changeset
243 sizeof(BinkDemuxContext),
d76904a638df Bink demuxer
pross
parents:
diff changeset
244 probe,
d76904a638df Bink demuxer
pross
parents:
diff changeset
245 read_header,
d76904a638df Bink demuxer
pross
parents:
diff changeset
246 read_packet,
d76904a638df Bink demuxer
pross
parents:
diff changeset
247 };