annotate wv.c @ 1334:5825a7bc0d96 libavformat

change codec id if sample size field is set to 24 in stsd, fix Sony-mx5p.mov
author bcoudurier
date Thu, 28 Sep 2006 17:52:48 +0000
parents 024cf76ac4d1
children 0899bfe4105c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1324
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
1 /*
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
2 * WavPack demuxer
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
3 * Copyright (c) 2006 Konstantin Shishkov.
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
4 *
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
9 *
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
13 * Lesser General Public License for more details.
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
14 *
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
18 */
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
19
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
20 #include "avformat.h"
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
21 #include "allformats.h"
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
22 #include "bswap.h"
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
23
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
24 // specs say that maximum block size is 1Mb
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
25 #define WV_BLOCK_LIMIT 1047576
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
26
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
27 #define WV_EXTRA_SIZE 12
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
28
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
29 enum WV_FLAGS{
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
30 WV_MONO = 0x0004,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
31 WV_HYBRID = 0x0008,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
32 WV_JOINT = 0x0010,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
33 WV_CROSSD = 0x0020,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
34 WV_HSHAPE = 0x0040,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
35 WV_FLOAT = 0x0080,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
36 WV_INT32 = 0x0100,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
37 WV_HBR = 0x0200,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
38 WV_HBAL = 0x0400,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
39 WV_MCINIT = 0x0800,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
40 WV_MCEND = 0x1000,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
41 };
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
42
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
43 static const int wv_rates[16] = {
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
44 6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
45 32000, 44100, 48000, 64000, 88200, 96000, 192000, -1
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
46 };
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
47
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
48 typedef struct{
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
49 uint32_t blksize, flags;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
50 int rate, chan, bpp;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
51 int block_parsed;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
52 uint8_t extra[WV_EXTRA_SIZE];
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
53 }WVContext;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
54
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
55 static int wv_probe(AVProbeData *p)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
56 {
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
57 /* check file header */
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
58 if (p->buf_size <= 32)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
59 return 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
60 if (p->buf[0] == 'w' && p->buf[1] == 'v' &&
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
61 p->buf[2] == 'p' && p->buf[3] == 'k')
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
62 return AVPROBE_SCORE_MAX;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
63 else
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
64 return 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
65 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
66
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
67 static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
68 {
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
69 WVContext *wc = ctx->priv_data;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
70 uint32_t tag, ver;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
71 int size;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
72 int rate, bpp, chan;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
73
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
74 tag = get_le32(pb);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
75 if (tag != MKTAG('w', 'v', 'p', 'k'))
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
76 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
77 size = get_le32(pb);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
78 if(size < 24 || size > WV_BLOCK_LIMIT){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
79 av_log(ctx, AV_LOG_ERROR, "Incorrect block size %i\n", size);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
80 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
81 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
82 wc->blksize = size;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
83 ver = get_le16(pb);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
84 if(ver < 0x402 || ver > 0x40F){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
85 av_log(ctx, AV_LOG_ERROR, "Unsupported version %03X\n", ver);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
86 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
87 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
88 get_byte(pb); // track no
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
89 get_byte(pb); // track sub index
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
90 get_le32(pb); // total samples in file
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
91 get_le32(pb); // offset in samples of current block
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
92 get_buffer(pb, wc->extra, WV_EXTRA_SIZE);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
93 wc->flags = LE_32(wc->extra + 4);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
94 //parse flags
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
95 if(wc->flags & WV_FLOAT){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
96 av_log(ctx, AV_LOG_ERROR, "Floating point data is not supported\n");
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
97 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
98 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
99 if(wc->flags & WV_HYBRID){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
100 av_log(ctx, AV_LOG_ERROR, "Hybrid coding mode is not supported\n");
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
101 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
102 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
103 if(wc->flags & WV_INT32){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
104 av_log(ctx, AV_LOG_ERROR, "Integer point data is not supported\n");
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
105 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
106 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
107
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
108 bpp = ((wc->flags & 3) + 1) << 3;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
109 chan = 1 + !(wc->flags & WV_MONO);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
110 rate = wv_rates[(wc->flags >> 23) & 0xF];
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
111 if(rate == -1){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
112 av_log(ctx, AV_LOG_ERROR, "Unknown sampling rate\n");
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
113 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
114 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
115 if(!wc->bpp) wc->bpp = bpp;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
116 if(!wc->chan) wc->chan = chan;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
117 if(!wc->rate) wc->rate = rate;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
118
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
119 if(bpp != wc->bpp){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
120 av_log(ctx, AV_LOG_ERROR, "Bits per sample differ, this block: %i, header block: %i\n", bpp, wc->bpp);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
121 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
122 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
123 if(chan != wc->chan){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
124 av_log(ctx, AV_LOG_ERROR, "Channels differ, this block: %i, header block: %i\n", chan, wc->chan);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
125 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
126 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
127 if(rate != wc->rate){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
128 av_log(ctx, AV_LOG_ERROR, "Sampling rate differ, this block: %i, header block: %i\n", rate, wc->rate);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
129 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
130 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
131 wc->blksize = size - 24;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
132 return 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
133 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
134
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
135 static int wv_read_header(AVFormatContext *s,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
136 AVFormatParameters *ap)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
137 {
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
138 ByteIOContext *pb = &s->pb;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
139 WVContext *wc = s->priv_data;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
140 AVStream *st;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
141
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
142 if(wv_read_block_header(s, pb) < 0)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
143 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
144
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
145 wc->block_parsed = 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
146 /* now we are ready: build format streams */
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
147 st = av_new_stream(s, 0);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
148 if (!st)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
149 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
150 st->codec->codec_type = CODEC_TYPE_AUDIO;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
151 st->codec->codec_id = CODEC_ID_WAVPACK;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
152 st->codec->channels = wc->chan;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
153 st->codec->sample_rate = wc->rate;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
154 st->codec->bits_per_sample = wc->bpp;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
155 av_set_pts_info(st, 64, 1, wc->rate);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
156 return 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
157 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
158
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
159 static int wv_read_packet(AVFormatContext *s,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
160 AVPacket *pkt)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
161 {
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
162 WVContext *wc = s->priv_data;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
163 int ret, samples;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
164
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
165 if (url_feof(&s->pb))
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
166 return -EIO;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
167 if(wc->block_parsed){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
168 if(wv_read_block_header(s, &s->pb) < 0)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
169 return -1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
170 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
171
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
172 samples = LE_32(wc->extra);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
173 /* should not happen but who knows */
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
174 if(samples * 2 * wc->chan > AVCODEC_MAX_AUDIO_FRAME_SIZE){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
175 av_log(s, AV_LOG_ERROR, "Packet size is too big to be handled in lavc!\n");
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
176 return -EIO;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
177 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
178 if(av_new_packet(pkt, wc->blksize + WV_EXTRA_SIZE) < 0)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
179 return AVERROR_NOMEM;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
180 memcpy(pkt->data, wc->extra, WV_EXTRA_SIZE);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
181 ret = get_buffer(&s->pb, pkt->data + WV_EXTRA_SIZE, wc->blksize);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
182 if(ret != wc->blksize){
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
183 av_free_packet(pkt);
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
184 return AVERROR_IO;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
185 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
186 pkt->stream_index = 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
187 wc->block_parsed = 1;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
188 pkt->size = ret + WV_EXTRA_SIZE;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
189
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
190 return 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
191 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
192
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
193 static int wv_read_close(AVFormatContext *s)
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
194 {
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
195 return 0;
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
196 }
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
197
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
198 AVInputFormat wv_demuxer = {
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
199 "wv",
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
200 "WavPack",
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
201 sizeof(WVContext),
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
202 wv_probe,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
203 wv_read_header,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
204 wv_read_packet,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
205 wv_read_close,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
206 pcm_read_seek,
024cf76ac4d1 WavPack lossless audio decoder
kostya
parents:
diff changeset
207 };