annotate sierravmd.c @ 1078:0bc9422cc0ad libavformat

Raw flac muxer, patch by Justin Ruggles (jruggle earthlink net). Can be used with "-acodec copy" to either copy a flac file verbatim or extract the raw flac from an ogg-flac file.
author banan
date Fri, 12 May 2006 15:13:51 +0000
parents 409b399440a3
children 40e81416015d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
1 /*
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
2 * Sierra VMD Format Demuxer
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
3 * Copyright (c) 2004 The ffmpeg Project
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
4 *
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
9 *
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
13 * Lesser General Public License for more details.
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
14 *
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
896
edbe5c3717f9 Update licensing information: The FSF changed postal address.
diego
parents: 887
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
18 */
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
19
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
20 /**
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
21 * @file sierravmd.c
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
22 * Sierra VMD file demuxer
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
23 * by Vladimir "VAG" Gneushev (vagsoft at mail.ru)
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
24 * for more information on the Sierra VMD file format, visit:
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
25 * http://www.pcisys.net/~melanson/codecs/
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
26 */
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
27
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
28 #include "avformat.h"
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
29
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
30 #define VMD_HEADER_SIZE 0x0330
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
31 #define BYTES_PER_FRAME_RECORD 16
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
32
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
33 typedef struct {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
34 int stream_index;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
35 offset_t frame_offset;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
36 unsigned int frame_size;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
37 int64_t pts;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
38 int keyframe;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
39 unsigned char frame_record[BYTES_PER_FRAME_RECORD];
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
40 } vmd_frame_t;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
41
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
42 typedef struct VmdDemuxContext {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
43 int video_stream_index;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
44 int audio_stream_index;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
45
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
46 unsigned int audio_type;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
47 unsigned int audio_samplerate;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
48 unsigned int audio_bits;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
49 unsigned int audio_channels;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
50
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
51 unsigned int frame_count;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
52 unsigned int frames_per_block;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
53 vmd_frame_t *frame_table;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
54 unsigned int current_frame;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
55
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
56 int sample_rate;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
57 int64_t audio_sample_counter;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
58 int audio_frame_divisor;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
59 int audio_block_align;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
60 int skiphdr;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
61
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
62 unsigned char vmd_header[VMD_HEADER_SIZE];
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
63 } VmdDemuxContext;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
64
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
65 static int vmd_probe(AVProbeData *p)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
66 {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
67 if (p->buf_size < 2)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
68 return 0;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
69
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
70 /* check if the first 2 bytes of the file contain the appropriate size
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
71 * of a VMD header chunk */
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
72 if (LE_16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
73 return 0;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
74
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
75 /* only return half certainty since this check is a bit sketchy */
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
76 return AVPROBE_SCORE_MAX / 2;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
77 }
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
78
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
79 /* This is a support function to determine the duration, in sample
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
80 * frames, of a particular audio chunk, taking into account silent
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
81 * encodings. */
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
82 static int vmd_calculate_audio_duration(unsigned char *audio_chunk,
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
83 int audio_chunk_size, int block_align)
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
84 {
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
85 unsigned char *p = audio_chunk + 16;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
86 unsigned char *p_end = audio_chunk + audio_chunk_size;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
87 int total_samples = 0;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
88 unsigned int sound_flags;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
89
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
90 if (audio_chunk_size < 16)
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
91 return 0;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
92 if (audio_chunk_size == block_align + 16)
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
93 return block_align;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
94 if (audio_chunk_size == block_align + 17)
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
95 return block_align;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
96
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
97 sound_flags = LE_32(p);
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
98 p += 4;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
99 while (p < p_end) {
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
100 total_samples += block_align;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
101 if ((sound_flags & 0x01) == 0)
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
102 p += block_align;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
103 sound_flags >>= 1;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
104 }
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
105 av_log(NULL,0,"Got %i samples for size %i map %08X\n", total_samples, audio_chunk_size, LE_32(audio_chunk));
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
106
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
107 return total_samples;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
108 }
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
109
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
110 static int vmd_read_header(AVFormatContext *s,
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
111 AVFormatParameters *ap)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
112 {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
113 VmdDemuxContext *vmd = (VmdDemuxContext *)s->priv_data;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
114 ByteIOContext *pb = &s->pb;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
115 AVStream *st;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
116 unsigned int toc_offset;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
117 unsigned char *raw_frame_table;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
118 int raw_frame_table_size;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
119 offset_t current_offset;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
120 int i, j;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
121 unsigned int total_frames;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
122 int64_t video_pts_inc = 0;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
123 int64_t current_video_pts = 0;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
124 unsigned char chunk[BYTES_PER_FRAME_RECORD];
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
125 int lastframe = 0;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
126
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
127 /* fetch the main header, including the 2 header length bytes */
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
128 url_fseek(pb, 0, SEEK_SET);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
129 if (get_buffer(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE)
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 462
diff changeset
130 return AVERROR_IO;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
131
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
132 vmd->audio_sample_counter = 0;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
133 vmd->audio_frame_divisor = 1;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
134 vmd->audio_block_align = 1;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
135
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
136 /* start up the decoders */
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
137 st = av_new_stream(s, 0);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
138 if (!st)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
139 return AVERROR_NOMEM;
462
b69898ffc92a move time_base (pts_num/pts_den) from AVFormatContext -> AVStream
michael
parents: 387
diff changeset
140 av_set_pts_info(st, 33, 1, 90000);
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
141 vmd->video_stream_index = st->index;
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
142 st->codec->codec_type = CODEC_TYPE_VIDEO;
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
143 st->codec->codec_id = CODEC_ID_VMDVIDEO;
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
144 st->codec->codec_tag = 0; /* no fourcc */
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
145 st->codec->width = LE_16(&vmd->vmd_header[12]);
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
146 st->codec->height = LE_16(&vmd->vmd_header[14]);
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
147 st->codec->time_base.num = 1;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
148 st->codec->time_base.den = 10;
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
149 st->codec->extradata_size = VMD_HEADER_SIZE;
884
2ece9c9dd94c malloc padding to avoid reading past the malloc()ed area.
henry
parents: 881
diff changeset
150 st->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
151 memcpy(st->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE);
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
152
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
153 /* if sample rate is 0, assume no audio */
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
154 vmd->sample_rate = LE_16(&vmd->vmd_header[804]);
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
155 if (vmd->sample_rate) {
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
156 st = av_new_stream(s, 0);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
157 if (!st)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
158 return AVERROR_NOMEM;
462
b69898ffc92a move time_base (pts_num/pts_den) from AVFormatContext -> AVStream
michael
parents: 387
diff changeset
159 av_set_pts_info(st, 33, 1, 90000);
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
160 vmd->audio_stream_index = st->index;
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
161 st->codec->codec_type = CODEC_TYPE_AUDIO;
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
162 st->codec->codec_id = CODEC_ID_VMDAUDIO;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
163 st->codec->codec_tag = 0; /* no fourcc */
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
164 st->codec->channels = vmd->audio_channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1;
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
165 st->codec->sample_rate = vmd->sample_rate;
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 884
diff changeset
166 st->codec->block_align = vmd->audio_block_align =
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
167 LE_16(&vmd->vmd_header[806]);
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
168 if (st->codec->block_align & 0x8000) {
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
169 st->codec->bits_per_sample = 16;
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
170 st->codec->block_align = -(st->codec->block_align - 0x10000);
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
171 vmd->audio_block_align = -(vmd->audio_block_align - 0x10000);
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
172 } else {
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
173 st->codec->bits_per_sample = 8;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
174 }
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 884
diff changeset
175 st->codec->bit_rate = st->codec->sample_rate *
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
176 st->codec->bits_per_sample * st->codec->channels;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
177
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
178 /* for calculating pts */
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
179 vmd->audio_frame_divisor = st->codec->channels;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
180
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
181 video_pts_inc = 90000;
820
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
182 video_pts_inc *= st->codec->block_align;
feca73904e67 changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents: 815
diff changeset
183 video_pts_inc /= st->codec->sample_rate;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
184 video_pts_inc /= st->codec->channels;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
185 } else {
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
186 /* if no audio, assume 10 frames/second */
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
187 video_pts_inc = 90000 / 10;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
188 }
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
189
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
190 toc_offset = LE_32(&vmd->vmd_header[812]);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
191 vmd->frame_count = LE_16(&vmd->vmd_header[6]);
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
192 vmd->frames_per_block = LE_16(&vmd->vmd_header[18]);
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
193 url_fseek(pb, toc_offset, SEEK_SET);
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
194
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
195 raw_frame_table = NULL;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
196 vmd->frame_table = NULL;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
197 raw_frame_table_size = vmd->frame_count * 6;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
198 raw_frame_table = av_malloc(raw_frame_table_size);
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
199 vmd->frame_table = av_malloc(vmd->frame_count * vmd->frames_per_block * sizeof(vmd_frame_t));
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
200 if (!raw_frame_table || !vmd->frame_table) {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
201 av_free(raw_frame_table);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
202 av_free(vmd->frame_table);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
203 return AVERROR_NOMEM;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
204 }
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 884
diff changeset
205 if (get_buffer(pb, raw_frame_table, raw_frame_table_size) !=
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
206 raw_frame_table_size) {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
207 av_free(raw_frame_table);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
208 av_free(vmd->frame_table);
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 462
diff changeset
209 return AVERROR_IO;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
210 }
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
211
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
212 total_frames = 0;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
213 for (i = 0; i < vmd->frame_count; i++) {
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
214
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
215 current_offset = LE_32(&raw_frame_table[6 * i + 2]);
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
216
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
217 /* handle each entry in index block */
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
218 for (j = 0; j < vmd->frames_per_block; j++) {
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
219 int type;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
220 uint32_t size;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
221
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
222 get_buffer(pb, chunk, BYTES_PER_FRAME_RECORD);
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
223 type = chunk[0];
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
224 size = LE_32(&chunk[2]);
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
225 if(!size)
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
226 continue;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
227 switch(type) {
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
228 case 1: /* Audio Chunk */
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
229 vmd->frame_table[total_frames].frame_offset = current_offset;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
230 vmd->frame_table[total_frames].stream_index = vmd->audio_stream_index;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
231 vmd->frame_table[total_frames].frame_size = size;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
232 memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD);
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
233 total_frames++;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
234 break;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
235 case 2: /* Video Chunk */
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
236 vmd->frame_table[total_frames].frame_offset = current_offset;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
237 vmd->frame_table[total_frames].frame_size = size;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
238 vmd->frame_table[total_frames].stream_index = vmd->video_stream_index;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
239 memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD);
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
240 vmd->frame_table[total_frames].pts = current_video_pts;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
241 if (lastframe) {
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
242 vmd->frame_table[lastframe].pts = current_video_pts - video_pts_inc;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
243 }
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
244 lastframe = total_frames;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
245 total_frames++;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
246 break;
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
247 }
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
248 current_offset += size;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
249 }
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
250 current_video_pts += video_pts_inc;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
251 }
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
252
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
253 av_free(raw_frame_table);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
254
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
255 vmd->current_frame = 0;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
256 vmd->frame_count = total_frames;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
257
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
258 return 0;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
259 }
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
260
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
261 static int vmd_read_packet(AVFormatContext *s,
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
262 AVPacket *pkt)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
263 {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
264 VmdDemuxContext *vmd = (VmdDemuxContext *)s->priv_data;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
265 ByteIOContext *pb = &s->pb;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
266 int ret = 0;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
267 vmd_frame_t *frame;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
268
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
269 if (vmd->current_frame >= vmd->frame_count)
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 462
diff changeset
270 return AVERROR_IO;
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
271
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
272 frame = &vmd->frame_table[vmd->current_frame];
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
273 /* position the stream (will probably be there already) */
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
274 url_fseek(pb, frame->frame_offset, SEEK_SET);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
275
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
276 if (av_new_packet(pkt, frame->frame_size + BYTES_PER_FRAME_RECORD))
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
277 return AVERROR_NOMEM;
775
c5077fdab490 AVPacket.pos
michael
parents: 669
diff changeset
278 pkt->pos= url_ftell(pb);
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
279 memcpy(pkt->data, frame->frame_record, BYTES_PER_FRAME_RECORD);
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 884
diff changeset
280 ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD,
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
281 frame->frame_size);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
282
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
283 if (ret != frame->frame_size) {
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
284 av_free_packet(pkt);
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 462
diff changeset
285 ret = AVERROR_IO;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
286 }
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
287 pkt->stream_index = frame->stream_index;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
288 if (frame->frame_record[0] == 0x02)
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
289 pkt->pts = frame->pts;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
290 else {
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
291 pkt->pts = vmd->audio_sample_counter;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
292 pkt->pts *= 90000;
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
293 pkt->pts /= vmd->sample_rate;
1004
409b399440a3 More correct demuxing and timestamp setting fot Sierra VMD
kostya
parents: 896
diff changeset
294 pkt->pts /= vmd->audio_channels;
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
295 vmd->audio_sample_counter += vmd_calculate_audio_duration(
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
296 pkt->data, pkt->size, vmd->audio_block_align);
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
297
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
298 }
881
91dcb9da9be6 use PRIxN, %zd, %td formats where needed
mru
parents: 820
diff changeset
299 av_log(NULL, AV_LOG_INFO, " dispatching %s frame with %d bytes and pts %"PRId64" (%0.1f sec)\n",
387
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
300 (frame->frame_record[0] == 0x02) ? "video" : "audio",
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
301 frame->frame_size + BYTES_PER_FRAME_RECORD,
f2760852ed18 minor VMD system update; still not perfect, but should not crash either
melanson
parents: 338
diff changeset
302 pkt->pts, (float)(pkt->pts / 90000.0));
338
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
303
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
304 vmd->current_frame++;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
305
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
306 return ret;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
307 }
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
308
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
309 static int vmd_read_close(AVFormatContext *s)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
310 {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
311 VmdDemuxContext *vmd = (VmdDemuxContext *)s->priv_data;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
312
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
313 av_free(vmd->frame_table);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
314
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
315 return 0;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
316 }
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
317
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
318 static AVInputFormat vmd_iformat = {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
319 "vmd",
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
320 "Sierra VMD format",
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
321 sizeof(VmdDemuxContext),
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
322 vmd_probe,
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
323 vmd_read_header,
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
324 vmd_read_packet,
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
325 vmd_read_close,
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
326 };
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
327
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
328 int vmd_init(void)
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
329 {
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
330 av_register_input_format(&vmd_iformat);
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
331 return 0;
6f50cb0ead51 initial commit for Sierra VMD file demuxer
melanson
parents:
diff changeset
332 }