]> git.sesse.net Git - ffmpeg/blob - libavformat/wavdec.c
w64dec: support metadata (summarylist guid)
[ffmpeg] / libavformat / wavdec.c
1 /*
2  * WAV demuxer
3  * Copyright (c) 2001, 2002 Fabrice Bellard
4  *
5  * Sony Wave64 demuxer
6  * RF64 demuxer
7  * Copyright (c) 2009 Daniel Verkamp
8  *
9  * This file is part of FFmpeg.
10  *
11  * FFmpeg is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * FFmpeg is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with FFmpeg; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24  */
25
26 #include "libavutil/avassert.h"
27 #include "libavutil/dict.h"
28 #include "libavutil/log.h"
29 #include "libavutil/mathematics.h"
30 #include "libavutil/opt.h"
31 #include "avformat.h"
32 #include "internal.h"
33 #include "avio_internal.h"
34 #include "pcm.h"
35 #include "riff.h"
36 #include "w64.h"
37 #include "avio.h"
38 #include "metadata.h"
39
40 typedef struct WAVDemuxContext {
41     const AVClass *class;
42     int64_t data_end;
43     int w64;
44     int64_t smv_data_ofs;
45     int smv_block_size;
46     int smv_frames_per_jpeg;
47     int smv_block;
48     int smv_last_stream;
49     int smv_eof;
50     int audio_eof;
51     int ignore_length;
52 } WAVDemuxContext;
53
54
55 #if CONFIG_WAV_DEMUXER
56
57 static int64_t next_tag(AVIOContext *pb, uint32_t *tag)
58 {
59     *tag = avio_rl32(pb);
60     return avio_rl32(pb);
61 }
62
63 /* return the size of the found tag */
64 static int64_t find_tag(AVIOContext *pb, uint32_t tag1)
65 {
66     unsigned int tag;
67     int64_t size;
68
69     for (;;) {
70         if (url_feof(pb))
71             return -1;
72         size = next_tag(pb, &tag);
73         if (tag == tag1)
74             break;
75         avio_skip(pb, size);
76     }
77     return size;
78 }
79
80 static int wav_probe(AVProbeData *p)
81 {
82     /* check file header */
83     if (p->buf_size <= 32)
84         return 0;
85     if (!memcmp(p->buf + 8, "WAVE", 4)) {
86         if (!memcmp(p->buf, "RIFF", 4))
87             /*
88               Since ACT demuxer has standard WAV header at top of it's own,
89               returning score is decreased to avoid probe conflict
90               between ACT and WAV.
91             */
92             return AVPROBE_SCORE_MAX - 1;
93         else if (!memcmp(p->buf,      "RF64", 4) &&
94                  !memcmp(p->buf + 12, "ds64", 4))
95             return AVPROBE_SCORE_MAX;
96     }
97     return 0;
98 }
99
100 static void handle_stream_probing(AVStream *st)
101 {
102     if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
103         st->request_probe = AVPROBE_SCORE_MAX/2;
104         st->probe_packets = FFMIN(st->probe_packets, 4);
105     }
106 }
107
108 static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
109 {
110     AVIOContext *pb = s->pb;
111     int ret;
112
113     /* parse fmt header */
114     *st = avformat_new_stream(s, NULL);
115     if (!*st)
116         return AVERROR(ENOMEM);
117
118     ret = ff_get_wav_header(pb, (*st)->codec, size);
119     if (ret < 0)
120         return ret;
121     handle_stream_probing(*st);
122
123     (*st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
124
125     avpriv_set_pts_info(*st, 64, 1, (*st)->codec->sample_rate);
126
127     return 0;
128 }
129
130 static inline int wav_parse_bext_string(AVFormatContext *s, const char *key,
131                                         int length)
132 {
133     char temp[257];
134     int ret;
135
136     av_assert0(length <= sizeof(temp));
137     if ((ret = avio_read(s->pb, temp, length)) < 0)
138         return ret;
139
140     temp[length] = 0;
141
142     if (strlen(temp))
143         return av_dict_set(&s->metadata, key, temp, 0);
144
145     return 0;
146 }
147
148 static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
149 {
150     char temp[131], *coding_history;
151     int ret, x;
152     uint64_t time_reference;
153     int64_t umid_parts[8], umid_mask = 0;
154
155     if ((ret = wav_parse_bext_string(s, "description", 256)) < 0 ||
156         (ret = wav_parse_bext_string(s, "originator", 32)) < 0 ||
157         (ret = wav_parse_bext_string(s, "originator_reference", 32)) < 0 ||
158         (ret = wav_parse_bext_string(s, "origination_date", 10)) < 0 ||
159         (ret = wav_parse_bext_string(s, "origination_time", 8)) < 0)
160         return ret;
161
162     time_reference = avio_rl64(s->pb);
163     snprintf(temp, sizeof(temp), "%"PRIu64, time_reference);
164     if ((ret = av_dict_set(&s->metadata, "time_reference", temp, 0)) < 0)
165         return ret;
166
167     /* check if version is >= 1, in which case an UMID may be present */
168     if (avio_rl16(s->pb) >= 1) {
169         for (x = 0; x < 8; x++)
170             umid_mask |= umid_parts[x] = avio_rb64(s->pb);
171
172         if (umid_mask) {
173             /* the string formatting below is per SMPTE 330M-2004 Annex C */
174             if (umid_parts[4] == 0 && umid_parts[5] == 0 && umid_parts[6] == 0 && umid_parts[7] == 0) {
175                 /* basic UMID */
176                 snprintf(temp, sizeof(temp), "0x%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64,
177                          umid_parts[0], umid_parts[1], umid_parts[2], umid_parts[3]);
178             } else {
179                 /* extended UMID */
180                 snprintf(temp, sizeof(temp), "0x%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64
181                                                "%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64,
182                          umid_parts[0], umid_parts[1], umid_parts[2], umid_parts[3],
183                          umid_parts[4], umid_parts[5], umid_parts[6], umid_parts[7]);
184             }
185
186             if ((ret = av_dict_set(&s->metadata, "umid", temp, 0)) < 0)
187                 return ret;
188         }
189
190         avio_skip(s->pb, 190);
191     } else
192         avio_skip(s->pb, 254);
193
194     if (size > 602) {
195         /* CodingHistory present */
196         size -= 602;
197
198         if (!(coding_history = av_malloc(size+1)))
199             return AVERROR(ENOMEM);
200
201         if ((ret = avio_read(s->pb, coding_history, size)) < 0)
202             return ret;
203
204         coding_history[size] = 0;
205         if ((ret = av_dict_set(&s->metadata, "coding_history", coding_history,
206                                AV_DICT_DONT_STRDUP_VAL)) < 0)
207             return ret;
208     }
209
210     return 0;
211 }
212
213 static const AVMetadataConv wav_metadata_conv[] = {
214     {"description",      "comment"      },
215     {"originator",       "encoded_by"   },
216     {"origination_date", "date"         },
217     {"origination_time", "creation_time"},
218     {0},
219 };
220
221 /* wav input */
222 static int wav_read_header(AVFormatContext *s)
223 {
224     int64_t size, av_uninit(data_size);
225     int64_t sample_count=0;
226     int rf64;
227     uint32_t tag;
228     AVIOContext *pb = s->pb;
229     AVStream *st = NULL;
230     WAVDemuxContext *wav = s->priv_data;
231     int ret, got_fmt = 0;
232     int64_t next_tag_ofs, data_ofs = -1;
233
234     wav->smv_data_ofs = -1;
235
236     /* check RIFF header */
237     tag = avio_rl32(pb);
238
239     rf64 = tag == MKTAG('R', 'F', '6', '4');
240     if (!rf64 && tag != MKTAG('R', 'I', 'F', 'F'))
241         return -1;
242     avio_rl32(pb); /* file size */
243     tag = avio_rl32(pb);
244     if (tag != MKTAG('W', 'A', 'V', 'E'))
245         return -1;
246
247     if (rf64) {
248         if (avio_rl32(pb) != MKTAG('d', 's', '6', '4'))
249             return -1;
250         size = avio_rl32(pb);
251         if (size < 24)
252             return -1;
253         avio_rl64(pb); /* RIFF size */
254         data_size = avio_rl64(pb);
255         sample_count = avio_rl64(pb);
256         if (data_size < 0 || sample_count < 0) {
257             av_log(s, AV_LOG_ERROR, "negative data_size and/or sample_count in "
258                    "ds64: data_size = %"PRId64", sample_count = %"PRId64"\n",
259                    data_size, sample_count);
260             return AVERROR_INVALIDDATA;
261         }
262         avio_skip(pb, size - 24); /* skip rest of ds64 chunk */
263
264     }
265
266     for (;;) {
267         AVStream *vst;
268         size = next_tag(pb, &tag);
269         next_tag_ofs = avio_tell(pb) + size;
270
271         if (url_feof(pb))
272             break;
273
274         switch (tag) {
275         case MKTAG('f', 'm', 't', ' '):
276             /* only parse the first 'fmt ' tag found */
277             if (!got_fmt && (ret = wav_parse_fmt_tag(s, size, &st)) < 0) {
278                 return ret;
279             } else if (got_fmt)
280                 av_log(s, AV_LOG_WARNING, "found more than one 'fmt ' tag\n");
281
282             got_fmt = 1;
283             break;
284         case MKTAG('d', 'a', 't', 'a'):
285             if (!got_fmt) {
286                 av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'data' tag\n");
287                 return AVERROR_INVALIDDATA;
288             }
289
290             if (rf64) {
291                 next_tag_ofs = wav->data_end = avio_tell(pb) + data_size;
292             } else {
293                 data_size = size;
294                 next_tag_ofs = wav->data_end = size ? next_tag_ofs : INT64_MAX;
295             }
296
297             data_ofs = avio_tell(pb);
298
299             /* don't look for footer metadata if we can't seek or if we don't
300              * know where the data tag ends
301              */
302             if (!pb->seekable || (!rf64 && !size))
303                 goto break_loop;
304             break;
305         case MKTAG('f','a','c','t'):
306             if (!sample_count)
307                 sample_count = avio_rl32(pb);
308             break;
309         case MKTAG('b','e','x','t'):
310             if ((ret = wav_parse_bext_tag(s, size)) < 0)
311                 return ret;
312             break;
313         case MKTAG('S','M','V','0'):
314             if (!got_fmt) {
315                 av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'SMV0' tag\n");
316                 return AVERROR_INVALIDDATA;
317             }
318             // SMV file, a wav file with video appended.
319             if (size != MKTAG('0','2','0','0')) {
320                 av_log(s, AV_LOG_ERROR, "Unknown SMV version found\n");
321                 goto break_loop;
322             }
323             av_log(s, AV_LOG_DEBUG, "Found SMV data\n");
324             vst = avformat_new_stream(s, NULL);
325             if (!vst)
326                 return AVERROR(ENOMEM);
327             avio_r8(pb);
328             vst->id = 1;
329             vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
330             vst->codec->codec_id = AV_CODEC_ID_MJPEG;
331             vst->codec->width  = avio_rl24(pb);
332             vst->codec->height = avio_rl24(pb);
333             size = avio_rl24(pb);
334             wav->smv_data_ofs = avio_tell(pb) + (size - 5) * 3;
335             avio_rl24(pb);
336             wav->smv_block_size = avio_rl24(pb);
337             avpriv_set_pts_info(vst, 32, 1, avio_rl24(pb));
338             vst->duration = avio_rl24(pb);
339             avio_rl24(pb);
340             avio_rl24(pb);
341             wav->smv_frames_per_jpeg = avio_rl24(pb);
342             goto break_loop;
343         case MKTAG('L', 'I', 'S', 'T'):
344             if (size < 4) {
345                 av_log(s, AV_LOG_ERROR, "too short LIST tag\n");
346                 return AVERROR_INVALIDDATA;
347             }
348             switch (avio_rl32(pb)) {
349             case MKTAG('I', 'N', 'F', 'O'):
350                 ff_read_riff_info(s, size - 4);
351             }
352             break;
353         }
354
355         /* seek to next tag unless we know that we'll run into EOF */
356         if ((avio_size(pb) > 0 && next_tag_ofs >= avio_size(pb)) ||
357             avio_seek(pb, next_tag_ofs, SEEK_SET) < 0) {
358             break;
359         }
360     }
361 break_loop:
362     if (data_ofs < 0) {
363         av_log(s, AV_LOG_ERROR, "no 'data' tag found\n");
364         return AVERROR_INVALIDDATA;
365     }
366
367     avio_seek(pb, data_ofs, SEEK_SET);
368
369     if (!sample_count && st->codec->channels && av_get_bits_per_sample(st->codec->codec_id) && wav->data_end <= avio_size(pb))
370         sample_count = (data_size<<3) / (st->codec->channels * (uint64_t)av_get_bits_per_sample(st->codec->codec_id));
371     if (sample_count)
372         st->duration = sample_count;
373
374     ff_metadata_conv_ctx(s, NULL, wav_metadata_conv);
375     ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv);
376
377     return 0;
378 }
379
380 /** Find chunk with w64 GUID by skipping over other chunks
381  * @return the size of the found chunk
382  */
383 static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
384 {
385     uint8_t guid[16];
386     int64_t size;
387
388     while (!url_feof(pb)) {
389         avio_read(pb, guid, 16);
390         size = avio_rl64(pb);
391         if (size <= 24)
392             return -1;
393         if (!memcmp(guid, guid1, 16))
394             return size;
395         avio_skip(pb, FFALIGN(size, INT64_C(8)) - 24);
396     }
397     return -1;
398 }
399
400 #define MAX_SIZE 4096
401
402 static int wav_read_packet(AVFormatContext *s,
403                            AVPacket *pkt)
404 {
405     int ret, size;
406     int64_t left;
407     AVStream *st;
408     WAVDemuxContext *wav = s->priv_data;
409
410     if (wav->smv_data_ofs > 0) {
411         int64_t audio_dts, video_dts;
412 smv_retry:
413         audio_dts = s->streams[0]->cur_dts;
414         video_dts = s->streams[1]->cur_dts;
415         if (audio_dts != AV_NOPTS_VALUE && video_dts != AV_NOPTS_VALUE) {
416             audio_dts = av_rescale_q(audio_dts, s->streams[0]->time_base, AV_TIME_BASE_Q);
417             video_dts = av_rescale_q(video_dts, s->streams[1]->time_base, AV_TIME_BASE_Q);
418             wav->smv_last_stream = video_dts >= audio_dts;
419         }
420         wav->smv_last_stream = !wav->smv_last_stream;
421         wav->smv_last_stream |= wav->audio_eof;
422         wav->smv_last_stream &= !wav->smv_eof;
423         if (wav->smv_last_stream) {
424             uint64_t old_pos = avio_tell(s->pb);
425             uint64_t new_pos = wav->smv_data_ofs +
426                 wav->smv_block * wav->smv_block_size;
427             if (avio_seek(s->pb, new_pos, SEEK_SET) < 0) {
428                 ret = AVERROR_EOF;
429                 goto smv_out;
430             }
431             size = avio_rl24(s->pb);
432             ret  = av_get_packet(s->pb, pkt, size);
433             if (ret < 0)
434                 goto smv_out;
435             pkt->pos -= 3;
436             pkt->pts = wav->smv_block * wav->smv_frames_per_jpeg;
437             wav->smv_block++;
438             pkt->stream_index = 1;
439 smv_out:
440             avio_seek(s->pb, old_pos, SEEK_SET);
441             if (ret == AVERROR_EOF) {
442                 wav->smv_eof = 1;
443                 goto smv_retry;
444             }
445             return ret;
446         }
447     }
448
449     st = s->streams[0];
450
451     left = wav->data_end - avio_tell(s->pb);
452     if (wav->ignore_length)
453         left= INT_MAX;
454     if (left <= 0){
455         if (CONFIG_W64_DEMUXER && wav->w64)
456             left = find_guid(s->pb, ff_w64_guid_data) - 24;
457         else
458             left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
459         if (left < 0) {
460             wav->audio_eof = 1;
461             if (wav->smv_data_ofs > 0 && !wav->smv_eof)
462                 goto smv_retry;
463             return AVERROR_EOF;
464         }
465         wav->data_end= avio_tell(s->pb) + left;
466     }
467
468     size = MAX_SIZE;
469     if (st->codec->block_align > 1) {
470         if (size < st->codec->block_align)
471             size = st->codec->block_align;
472         size = (size / st->codec->block_align) * st->codec->block_align;
473     }
474     size = FFMIN(size, left);
475     ret  = av_get_packet(s->pb, pkt, size);
476     if (ret < 0)
477         return ret;
478     pkt->stream_index = 0;
479
480     return ret;
481 }
482
483 static int wav_read_seek(AVFormatContext *s,
484                          int stream_index, int64_t timestamp, int flags)
485 {
486     WAVDemuxContext *wav = s->priv_data;
487     AVStream *st;
488     wav->smv_eof = 0;
489     wav->audio_eof = 0;
490     if (wav->smv_data_ofs > 0) {
491         int64_t smv_timestamp = timestamp;
492         if (stream_index == 0)
493             smv_timestamp = av_rescale_q(timestamp, s->streams[0]->time_base, s->streams[1]->time_base);
494         else
495             timestamp = av_rescale_q(smv_timestamp, s->streams[1]->time_base, s->streams[0]->time_base);
496         wav->smv_block = smv_timestamp / wav->smv_frames_per_jpeg;
497     }
498
499     st = s->streams[0];
500     switch (st->codec->codec_id) {
501     case AV_CODEC_ID_MP2:
502     case AV_CODEC_ID_MP3:
503     case AV_CODEC_ID_AC3:
504     case AV_CODEC_ID_DTS:
505         /* use generic seeking with dynamically generated indexes */
506         return -1;
507     default:
508         break;
509     }
510     return ff_pcm_read_seek(s, stream_index, timestamp, flags);
511 }
512
513 #define OFFSET(x) offsetof(WAVDemuxContext, x)
514 #define DEC AV_OPT_FLAG_DECODING_PARAM
515 static const AVOption demux_options[] = {
516     { "ignore_length", "Ignore length", OFFSET(ignore_length), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, DEC },
517     { NULL },
518 };
519
520 static const AVClass wav_demuxer_class = {
521     .class_name = "WAV demuxer",
522     .item_name  = av_default_item_name,
523     .option     = demux_options,
524     .version    = LIBAVUTIL_VERSION_INT,
525 };
526 AVInputFormat ff_wav_demuxer = {
527     .name           = "wav",
528     .long_name      = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
529     .priv_data_size = sizeof(WAVDemuxContext),
530     .read_probe     = wav_probe,
531     .read_header    = wav_read_header,
532     .read_packet    = wav_read_packet,
533     .read_seek      = wav_read_seek,
534     .flags          = AVFMT_GENERIC_INDEX,
535     .codec_tag      = (const AVCodecTag* const []){ ff_codec_wav_tags, 0 },
536     .priv_class     = &wav_demuxer_class,
537 };
538 #endif /* CONFIG_WAV_DEMUXER */
539
540
541 #if CONFIG_W64_DEMUXER
542 static int w64_probe(AVProbeData *p)
543 {
544     if (p->buf_size <= 40)
545         return 0;
546     if (!memcmp(p->buf,      ff_w64_guid_riff, 16) &&
547         !memcmp(p->buf + 24, ff_w64_guid_wave, 16))
548         return AVPROBE_SCORE_MAX;
549     else
550         return 0;
551 }
552
553 static int w64_read_header(AVFormatContext *s)
554 {
555     int64_t size, data_ofs = 0;
556     AVIOContext *pb  = s->pb;
557     WAVDemuxContext    *wav = s->priv_data;
558     AVStream *st;
559     uint8_t guid[16];
560     int ret;
561
562     avio_read(pb, guid, 16);
563     if (memcmp(guid, ff_w64_guid_riff, 16))
564         return -1;
565
566     if (avio_rl64(pb) < 16 + 8 + 16 + 8 + 16 + 8) /* riff + wave + fmt + sizes */
567         return -1;
568
569     avio_read(pb, guid, 16);
570     if (memcmp(guid, ff_w64_guid_wave, 16)) {
571         av_log(s, AV_LOG_ERROR, "could not find wave guid\n");
572         return -1;
573     }
574
575     wav->w64 = 1;
576
577     st = avformat_new_stream(s, NULL);
578     if (!st)
579         return AVERROR(ENOMEM);
580
581     while (!url_feof(pb)) {
582         if (avio_read(pb, guid, 16) != 16)
583             break;
584         size = avio_rl64(pb);
585         if (size <= 24 || INT64_MAX - size < avio_tell(pb))
586             return AVERROR_INVALIDDATA;
587
588         if (!memcmp(guid, ff_w64_guid_fmt, 16)) {
589             /* subtract chunk header size - normal wav file doesn't count it */
590             ret = ff_get_wav_header(pb, st->codec, size - 24);
591             if (ret < 0)
592                 return ret;
593             avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
594
595             avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
596         } else if (!memcmp(guid, ff_w64_guid_data, 16)) {
597             wav->data_end = avio_tell(pb) + size - 24;
598
599             data_ofs = avio_tell(pb);
600             if (!pb->seekable)
601                 break;
602
603             avio_skip(pb, size - 24);
604         } else if (!memcmp(guid, ff_w64_guid_summarylist, 16)) {
605             int64_t start, end, cur;
606             uint32_t count, chunk_size, i;
607
608             start = avio_tell(pb);
609             end = start + size;
610             count = avio_rl32(pb);
611
612             for (i = 0; i < count; i++) {
613                 char chunk_key[5], *value;
614
615                 if (url_feof(pb) || (cur = avio_tell(pb)) < 0 || cur > end - 8 /* = tag + size */)
616                     break;
617
618                 chunk_key[4] = 0;
619                 avio_read(pb, chunk_key, 4);
620                 chunk_size = avio_rl32(pb);
621
622                 value = av_mallocz(chunk_size + 1);
623                 if (!value)
624                     return AVERROR(ENOMEM);
625
626                 ret = avio_get_str16le(pb, chunk_size, value, chunk_size);
627                 avio_skip(pb, chunk_size - ret);
628
629                 av_dict_set(&s->metadata, chunk_key, value, AV_DICT_DONT_STRDUP_VAL);
630             }
631
632             avio_skip(pb, end - avio_tell(pb));
633         } else {
634             av_log(s, AV_LOG_DEBUG, "unknown guid: "FF_PRI_GUID"\n", FF_ARG_GUID(guid));
635             avio_skip(pb, size - 24);
636         }
637     }
638
639     if (!data_ofs)
640         return AVERROR_EOF;
641
642     ff_metadata_conv_ctx(s, NULL, wav_metadata_conv);
643     ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv);
644
645     handle_stream_probing(st);
646     st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
647
648     avio_seek(pb, data_ofs, SEEK_SET);
649
650     return 0;
651 }
652
653 AVInputFormat ff_w64_demuxer = {
654     .name           = "w64",
655     .long_name      = NULL_IF_CONFIG_SMALL("Sony Wave64"),
656     .priv_data_size = sizeof(WAVDemuxContext),
657     .read_probe     = w64_probe,
658     .read_header    = w64_read_header,
659     .read_packet    = wav_read_packet,
660     .read_seek      = wav_read_seek,
661     .flags          = AVFMT_GENERIC_INDEX,
662     .codec_tag      = (const AVCodecTag* const []){ ff_codec_wav_tags, 0 },
663 };
664 #endif /* CONFIG_W64_DEMUXER */