You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

631 lines
19KB

  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. #include "libavutil/avassert.h"
  26. #include "libavutil/dict.h"
  27. #include "libavutil/log.h"
  28. #include "libavutil/mathematics.h"
  29. #include "libavutil/opt.h"
  30. #include "avformat.h"
  31. #include "internal.h"
  32. #include "avio_internal.h"
  33. #include "pcm.h"
  34. #include "riff.h"
  35. #include "avio.h"
  36. #include "metadata.h"
  37. typedef struct WAVDemuxContext {
  38. const AVClass *class;
  39. int64_t data_end;
  40. int w64;
  41. int64_t smv_data_ofs;
  42. int smv_block_size;
  43. int smv_frames_per_jpeg;
  44. int smv_block;
  45. int smv_last_stream;
  46. int smv_eof;
  47. int audio_eof;
  48. int ignore_length;
  49. } WAVDemuxContext;
  50. #if CONFIG_WAV_DEMUXER
  51. static int64_t next_tag(AVIOContext *pb, uint32_t *tag)
  52. {
  53. *tag = avio_rl32(pb);
  54. return avio_rl32(pb);
  55. }
  56. /* return the size of the found tag */
  57. static int64_t find_tag(AVIOContext *pb, uint32_t tag1)
  58. {
  59. unsigned int tag;
  60. int64_t size;
  61. for (;;) {
  62. if (url_feof(pb))
  63. return -1;
  64. size = next_tag(pb, &tag);
  65. if (tag == tag1)
  66. break;
  67. avio_skip(pb, size);
  68. }
  69. return size;
  70. }
  71. static int wav_probe(AVProbeData *p)
  72. {
  73. /* check file header */
  74. if (p->buf_size <= 32)
  75. return 0;
  76. if (!memcmp(p->buf + 8, "WAVE", 4)) {
  77. if (!memcmp(p->buf, "RIFF", 4))
  78. /*
  79. Since ACT demuxer has standard WAV header at top of it's own,
  80. returning score is decreased to avoid probe conflict
  81. between ACT and WAV.
  82. */
  83. return AVPROBE_SCORE_MAX - 1;
  84. else if (!memcmp(p->buf, "RF64", 4) &&
  85. !memcmp(p->buf + 12, "ds64", 4))
  86. return AVPROBE_SCORE_MAX;
  87. }
  88. return 0;
  89. }
  90. static void handle_stream_probing(AVStream *st)
  91. {
  92. if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
  93. st->request_probe = AVPROBE_SCORE_MAX/2;
  94. st->probe_packets = FFMIN(st->probe_packets, 4);
  95. }
  96. }
  97. static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
  98. {
  99. AVIOContext *pb = s->pb;
  100. int ret;
  101. /* parse fmt header */
  102. *st = avformat_new_stream(s, NULL);
  103. if (!*st)
  104. return AVERROR(ENOMEM);
  105. ret = ff_get_wav_header(pb, (*st)->codec, size);
  106. if (ret < 0)
  107. return ret;
  108. handle_stream_probing(*st);
  109. (*st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
  110. avpriv_set_pts_info(*st, 64, 1, (*st)->codec->sample_rate);
  111. return 0;
  112. }
  113. static inline int wav_parse_bext_string(AVFormatContext *s, const char *key,
  114. int length)
  115. {
  116. char temp[257];
  117. int ret;
  118. av_assert0(length <= sizeof(temp));
  119. if ((ret = avio_read(s->pb, temp, length)) < 0)
  120. return ret;
  121. temp[length] = 0;
  122. if (strlen(temp))
  123. return av_dict_set(&s->metadata, key, temp, 0);
  124. return 0;
  125. }
  126. static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
  127. {
  128. char temp[131], *coding_history;
  129. int ret, x;
  130. uint64_t time_reference;
  131. int64_t umid_parts[8], umid_mask = 0;
  132. if ((ret = wav_parse_bext_string(s, "description", 256)) < 0 ||
  133. (ret = wav_parse_bext_string(s, "originator", 32)) < 0 ||
  134. (ret = wav_parse_bext_string(s, "originator_reference", 32)) < 0 ||
  135. (ret = wav_parse_bext_string(s, "origination_date", 10)) < 0 ||
  136. (ret = wav_parse_bext_string(s, "origination_time", 8)) < 0)
  137. return ret;
  138. time_reference = avio_rl64(s->pb);
  139. snprintf(temp, sizeof(temp), "%"PRIu64, time_reference);
  140. if ((ret = av_dict_set(&s->metadata, "time_reference", temp, 0)) < 0)
  141. return ret;
  142. /* check if version is >= 1, in which case an UMID may be present */
  143. if (avio_rl16(s->pb) >= 1) {
  144. for (x = 0; x < 8; x++)
  145. umid_mask |= umid_parts[x] = avio_rb64(s->pb);
  146. if (umid_mask) {
  147. /* the string formatting below is per SMPTE 330M-2004 Annex C */
  148. if (umid_parts[4] == 0 && umid_parts[5] == 0 && umid_parts[6] == 0 && umid_parts[7] == 0) {
  149. /* basic UMID */
  150. snprintf(temp, sizeof(temp), "0x%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64,
  151. umid_parts[0], umid_parts[1], umid_parts[2], umid_parts[3]);
  152. } else {
  153. /* extended UMID */
  154. snprintf(temp, sizeof(temp), "0x%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64
  155. "%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64,
  156. umid_parts[0], umid_parts[1], umid_parts[2], umid_parts[3],
  157. umid_parts[4], umid_parts[5], umid_parts[6], umid_parts[7]);
  158. }
  159. if ((ret = av_dict_set(&s->metadata, "umid", temp, 0)) < 0)
  160. return ret;
  161. }
  162. avio_skip(s->pb, 190);
  163. } else
  164. avio_skip(s->pb, 254);
  165. if (size > 602) {
  166. /* CodingHistory present */
  167. size -= 602;
  168. if (!(coding_history = av_malloc(size+1)))
  169. return AVERROR(ENOMEM);
  170. if ((ret = avio_read(s->pb, coding_history, size)) < 0)
  171. return ret;
  172. coding_history[size] = 0;
  173. if ((ret = av_dict_set(&s->metadata, "coding_history", coding_history,
  174. AV_DICT_DONT_STRDUP_VAL)) < 0)
  175. return ret;
  176. }
  177. return 0;
  178. }
  179. static const AVMetadataConv wav_metadata_conv[] = {
  180. {"description", "comment" },
  181. {"originator", "encoded_by" },
  182. {"origination_date", "date" },
  183. {"origination_time", "creation_time"},
  184. {0},
  185. };
  186. /* wav input */
  187. static int wav_read_header(AVFormatContext *s)
  188. {
  189. int64_t size, av_uninit(data_size);
  190. int64_t sample_count=0;
  191. int rf64;
  192. uint32_t tag;
  193. AVIOContext *pb = s->pb;
  194. AVStream *st = NULL;
  195. WAVDemuxContext *wav = s->priv_data;
  196. int ret, got_fmt = 0;
  197. int64_t next_tag_ofs, data_ofs = -1;
  198. wav->smv_data_ofs = -1;
  199. /* check RIFF header */
  200. tag = avio_rl32(pb);
  201. rf64 = tag == MKTAG('R', 'F', '6', '4');
  202. if (!rf64 && tag != MKTAG('R', 'I', 'F', 'F'))
  203. return -1;
  204. avio_rl32(pb); /* file size */
  205. tag = avio_rl32(pb);
  206. if (tag != MKTAG('W', 'A', 'V', 'E'))
  207. return -1;
  208. if (rf64) {
  209. if (avio_rl32(pb) != MKTAG('d', 's', '6', '4'))
  210. return -1;
  211. size = avio_rl32(pb);
  212. if (size < 24)
  213. return -1;
  214. avio_rl64(pb); /* RIFF size */
  215. data_size = avio_rl64(pb);
  216. sample_count = avio_rl64(pb);
  217. if (data_size < 0 || sample_count < 0) {
  218. av_log(s, AV_LOG_ERROR, "negative data_size and/or sample_count in "
  219. "ds64: data_size = %"PRId64", sample_count = %"PRId64"\n",
  220. data_size, sample_count);
  221. return AVERROR_INVALIDDATA;
  222. }
  223. avio_skip(pb, size - 24); /* skip rest of ds64 chunk */
  224. }
  225. for (;;) {
  226. AVStream *vst;
  227. size = next_tag(pb, &tag);
  228. next_tag_ofs = avio_tell(pb) + size;
  229. if (url_feof(pb))
  230. break;
  231. switch (tag) {
  232. case MKTAG('f', 'm', 't', ' '):
  233. /* only parse the first 'fmt ' tag found */
  234. if (!got_fmt && (ret = wav_parse_fmt_tag(s, size, &st)) < 0) {
  235. return ret;
  236. } else if (got_fmt)
  237. av_log(s, AV_LOG_WARNING, "found more than one 'fmt ' tag\n");
  238. got_fmt = 1;
  239. break;
  240. case MKTAG('d', 'a', 't', 'a'):
  241. if (!got_fmt) {
  242. av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'data' tag\n");
  243. return AVERROR_INVALIDDATA;
  244. }
  245. if (rf64) {
  246. next_tag_ofs = wav->data_end = avio_tell(pb) + data_size;
  247. } else {
  248. data_size = size;
  249. next_tag_ofs = wav->data_end = size ? next_tag_ofs : INT64_MAX;
  250. }
  251. data_ofs = avio_tell(pb);
  252. /* don't look for footer metadata if we can't seek or if we don't
  253. * know where the data tag ends
  254. */
  255. if (!pb->seekable || (!rf64 && !size))
  256. goto break_loop;
  257. break;
  258. case MKTAG('f','a','c','t'):
  259. if (!sample_count)
  260. sample_count = avio_rl32(pb);
  261. break;
  262. case MKTAG('b','e','x','t'):
  263. if ((ret = wav_parse_bext_tag(s, size)) < 0)
  264. return ret;
  265. break;
  266. case MKTAG('S','M','V','0'):
  267. if (!got_fmt) {
  268. av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'SMV0' tag\n");
  269. return AVERROR_INVALIDDATA;
  270. }
  271. // SMV file, a wav file with video appended.
  272. if (size != MKTAG('0','2','0','0')) {
  273. av_log(s, AV_LOG_ERROR, "Unknown SMV version found\n");
  274. goto break_loop;
  275. }
  276. av_log(s, AV_LOG_DEBUG, "Found SMV data\n");
  277. vst = avformat_new_stream(s, NULL);
  278. if (!vst)
  279. return AVERROR(ENOMEM);
  280. avio_r8(pb);
  281. vst->id = 1;
  282. vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
  283. vst->codec->codec_id = AV_CODEC_ID_MJPEG;
  284. vst->codec->width = avio_rl24(pb);
  285. vst->codec->height = avio_rl24(pb);
  286. size = avio_rl24(pb);
  287. wav->smv_data_ofs = avio_tell(pb) + (size - 5) * 3;
  288. avio_rl24(pb);
  289. wav->smv_block_size = avio_rl24(pb);
  290. avpriv_set_pts_info(vst, 32, 1, avio_rl24(pb));
  291. vst->duration = avio_rl24(pb);
  292. avio_rl24(pb);
  293. avio_rl24(pb);
  294. wav->smv_frames_per_jpeg = avio_rl24(pb);
  295. goto break_loop;
  296. case MKTAG('L', 'I', 'S', 'T'):
  297. if (size < 4) {
  298. av_log(s, AV_LOG_ERROR, "too short LIST tag\n");
  299. return AVERROR_INVALIDDATA;
  300. }
  301. switch (avio_rl32(pb)) {
  302. case MKTAG('I', 'N', 'F', 'O'):
  303. if ((ret = ff_read_riff_info(s, size - 4)) < 0)
  304. return ret;
  305. }
  306. break;
  307. }
  308. /* seek to next tag unless we know that we'll run into EOF */
  309. if ((avio_size(pb) > 0 && next_tag_ofs >= avio_size(pb)) ||
  310. avio_seek(pb, next_tag_ofs, SEEK_SET) < 0) {
  311. break;
  312. }
  313. }
  314. break_loop:
  315. if (data_ofs < 0) {
  316. av_log(s, AV_LOG_ERROR, "no 'data' tag found\n");
  317. return AVERROR_INVALIDDATA;
  318. }
  319. avio_seek(pb, data_ofs, SEEK_SET);
  320. if (!sample_count && st->codec->channels && av_get_bits_per_sample(st->codec->codec_id))
  321. sample_count = (data_size<<3) / (st->codec->channels * (uint64_t)av_get_bits_per_sample(st->codec->codec_id));
  322. if (sample_count)
  323. st->duration = sample_count;
  324. ff_metadata_conv_ctx(s, NULL, wav_metadata_conv);
  325. ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv);
  326. return 0;
  327. }
  328. /** Find chunk with w64 GUID by skipping over other chunks
  329. * @return the size of the found chunk
  330. */
  331. static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
  332. {
  333. uint8_t guid[16];
  334. int64_t size;
  335. while (!url_feof(pb)) {
  336. avio_read(pb, guid, 16);
  337. size = avio_rl64(pb);
  338. if (size <= 24)
  339. return -1;
  340. if (!memcmp(guid, guid1, 16))
  341. return size;
  342. avio_skip(pb, FFALIGN(size, INT64_C(8)) - 24);
  343. }
  344. return -1;
  345. }
  346. static const uint8_t guid_data[16] = { 'd', 'a', 't', 'a',
  347. 0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A };
  348. #define MAX_SIZE 4096
  349. static int wav_read_packet(AVFormatContext *s,
  350. AVPacket *pkt)
  351. {
  352. int ret, size;
  353. int64_t left;
  354. AVStream *st;
  355. WAVDemuxContext *wav = s->priv_data;
  356. if (wav->smv_data_ofs > 0) {
  357. int64_t audio_dts, video_dts;
  358. smv_retry:
  359. audio_dts = s->streams[0]->cur_dts;
  360. video_dts = s->streams[1]->cur_dts;
  361. if (audio_dts != AV_NOPTS_VALUE && video_dts != AV_NOPTS_VALUE) {
  362. audio_dts = av_rescale_q(audio_dts, s->streams[0]->time_base, AV_TIME_BASE_Q);
  363. video_dts = av_rescale_q(video_dts, s->streams[1]->time_base, AV_TIME_BASE_Q);
  364. wav->smv_last_stream = video_dts >= audio_dts;
  365. }
  366. wav->smv_last_stream = !wav->smv_last_stream;
  367. wav->smv_last_stream |= wav->audio_eof;
  368. wav->smv_last_stream &= !wav->smv_eof;
  369. if (wav->smv_last_stream) {
  370. uint64_t old_pos = avio_tell(s->pb);
  371. uint64_t new_pos = wav->smv_data_ofs +
  372. wav->smv_block * wav->smv_block_size;
  373. if (avio_seek(s->pb, new_pos, SEEK_SET) < 0) {
  374. ret = AVERROR_EOF;
  375. goto smv_out;
  376. }
  377. size = avio_rl24(s->pb);
  378. ret = av_get_packet(s->pb, pkt, size);
  379. if (ret < 0)
  380. goto smv_out;
  381. pkt->pos -= 3;
  382. pkt->pts = wav->smv_block * wav->smv_frames_per_jpeg;
  383. wav->smv_block++;
  384. pkt->stream_index = 1;
  385. smv_out:
  386. avio_seek(s->pb, old_pos, SEEK_SET);
  387. if (ret == AVERROR_EOF) {
  388. wav->smv_eof = 1;
  389. goto smv_retry;
  390. }
  391. return ret;
  392. }
  393. }
  394. st = s->streams[0];
  395. left = wav->data_end - avio_tell(s->pb);
  396. if (wav->ignore_length)
  397. left= INT_MAX;
  398. if (left <= 0){
  399. if (CONFIG_W64_DEMUXER && wav->w64)
  400. left = find_guid(s->pb, guid_data) - 24;
  401. else
  402. left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
  403. if (left < 0) {
  404. wav->audio_eof = 1;
  405. if (wav->smv_data_ofs > 0 && !wav->smv_eof)
  406. goto smv_retry;
  407. return AVERROR_EOF;
  408. }
  409. wav->data_end= avio_tell(s->pb) + left;
  410. }
  411. size = MAX_SIZE;
  412. if (st->codec->block_align > 1) {
  413. if (size < st->codec->block_align)
  414. size = st->codec->block_align;
  415. size = (size / st->codec->block_align) * st->codec->block_align;
  416. }
  417. size = FFMIN(size, left);
  418. ret = av_get_packet(s->pb, pkt, size);
  419. if (ret < 0)
  420. return ret;
  421. pkt->stream_index = 0;
  422. return ret;
  423. }
  424. static int wav_read_seek(AVFormatContext *s,
  425. int stream_index, int64_t timestamp, int flags)
  426. {
  427. WAVDemuxContext *wav = s->priv_data;
  428. AVStream *st;
  429. wav->smv_eof = 0;
  430. wav->audio_eof = 0;
  431. if (wav->smv_data_ofs > 0) {
  432. int64_t smv_timestamp = timestamp;
  433. if (stream_index == 0)
  434. smv_timestamp = av_rescale_q(timestamp, s->streams[0]->time_base, s->streams[1]->time_base);
  435. else
  436. timestamp = av_rescale_q(smv_timestamp, s->streams[1]->time_base, s->streams[0]->time_base);
  437. wav->smv_block = smv_timestamp / wav->smv_frames_per_jpeg;
  438. }
  439. st = s->streams[0];
  440. switch (st->codec->codec_id) {
  441. case AV_CODEC_ID_MP2:
  442. case AV_CODEC_ID_MP3:
  443. case AV_CODEC_ID_AC3:
  444. case AV_CODEC_ID_DTS:
  445. /* use generic seeking with dynamically generated indexes */
  446. return -1;
  447. default:
  448. break;
  449. }
  450. return ff_pcm_read_seek(s, stream_index, timestamp, flags);
  451. }
  452. #define OFFSET(x) offsetof(WAVDemuxContext, x)
  453. #define DEC AV_OPT_FLAG_DECODING_PARAM
  454. static const AVOption demux_options[] = {
  455. { "ignore_length", "Ignore length", OFFSET(ignore_length), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, DEC },
  456. { NULL },
  457. };
  458. static const AVClass wav_demuxer_class = {
  459. .class_name = "WAV demuxer",
  460. .item_name = av_default_item_name,
  461. .option = demux_options,
  462. .version = LIBAVUTIL_VERSION_INT,
  463. };
  464. AVInputFormat ff_wav_demuxer = {
  465. .name = "wav",
  466. .long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
  467. .priv_data_size = sizeof(WAVDemuxContext),
  468. .read_probe = wav_probe,
  469. .read_header = wav_read_header,
  470. .read_packet = wav_read_packet,
  471. .read_seek = wav_read_seek,
  472. .flags = AVFMT_GENERIC_INDEX,
  473. .codec_tag = (const AVCodecTag* const []){ ff_codec_wav_tags, 0 },
  474. .priv_class = &wav_demuxer_class,
  475. };
  476. #endif /* CONFIG_WAV_DEMUXER */
  477. #if CONFIG_W64_DEMUXER
  478. static const uint8_t guid_riff[16] = { 'r', 'i', 'f', 'f',
  479. 0x2E, 0x91, 0xCF, 0x11, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 };
  480. static const uint8_t guid_wave[16] = { 'w', 'a', 'v', 'e',
  481. 0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A };
  482. static const uint8_t guid_fmt [16] = { 'f', 'm', 't', ' ',
  483. 0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A };
  484. static int w64_probe(AVProbeData *p)
  485. {
  486. if (p->buf_size <= 40)
  487. return 0;
  488. if (!memcmp(p->buf, guid_riff, 16) &&
  489. !memcmp(p->buf + 24, guid_wave, 16))
  490. return AVPROBE_SCORE_MAX;
  491. else
  492. return 0;
  493. }
  494. static int w64_read_header(AVFormatContext *s)
  495. {
  496. int64_t size;
  497. AVIOContext *pb = s->pb;
  498. WAVDemuxContext *wav = s->priv_data;
  499. AVStream *st;
  500. uint8_t guid[16];
  501. int ret;
  502. avio_read(pb, guid, 16);
  503. if (memcmp(guid, guid_riff, 16))
  504. return -1;
  505. if (avio_rl64(pb) < 16 + 8 + 16 + 8 + 16 + 8) /* riff + wave + fmt + sizes */
  506. return -1;
  507. avio_read(pb, guid, 16);
  508. if (memcmp(guid, guid_wave, 16)) {
  509. av_log(s, AV_LOG_ERROR, "could not find wave guid\n");
  510. return -1;
  511. }
  512. size = find_guid(pb, guid_fmt);
  513. if (size < 0) {
  514. av_log(s, AV_LOG_ERROR, "could not find fmt guid\n");
  515. return -1;
  516. }
  517. st = avformat_new_stream(s, NULL);
  518. if (!st)
  519. return AVERROR(ENOMEM);
  520. /* subtract chunk header size - normal wav file doesn't count it */
  521. ret = ff_get_wav_header(pb, st->codec, size - 24);
  522. if (ret < 0)
  523. return ret;
  524. avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
  525. handle_stream_probing(st);
  526. st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
  527. avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
  528. size = find_guid(pb, guid_data);
  529. if (size < 0) {
  530. av_log(s, AV_LOG_ERROR, "could not find data guid\n");
  531. return -1;
  532. }
  533. wav->data_end = avio_tell(pb) + size - 24;
  534. wav->w64 = 1;
  535. return 0;
  536. }
  537. AVInputFormat ff_w64_demuxer = {
  538. .name = "w64",
  539. .long_name = NULL_IF_CONFIG_SMALL("Sony Wave64"),
  540. .priv_data_size = sizeof(WAVDemuxContext),
  541. .read_probe = w64_probe,
  542. .read_header = w64_read_header,
  543. .read_packet = wav_read_packet,
  544. .read_seek = wav_read_seek,
  545. .flags = AVFMT_GENERIC_INDEX,
  546. .codec_tag = (const AVCodecTag* const []){ ff_codec_wav_tags, 0 },
  547. };
  548. #endif /* CONFIG_W64_DEMUXER */