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.

626 lines
18KB

  1. /*
  2. * Sony OpenMG (OMA) demuxer
  3. *
  4. * Copyright (c) 2008, 2013 Maxim Poliakovski
  5. * 2008 Benjamin Larsson
  6. * 2011 David Goldwich
  7. *
  8. * This file is part of FFmpeg.
  9. *
  10. * FFmpeg is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * FFmpeg is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with FFmpeg; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. */
  24. /**
  25. * @file
  26. * This is a demuxer for Sony OpenMG Music files
  27. *
  28. * Known file extensions: ".oma", "aa3"
  29. * The format of such files consists of three parts:
  30. * - "ea3" header carrying overall info and metadata. Except for starting with
  31. * "ea" instead of "ID", it's an ID3v2 header.
  32. * - "EA3" header is a Sony-specific header containing information about
  33. * the OpenMG file: codec type (usually ATRAC, can also be MP3 or WMA),
  34. * codec specific info (packet size, sample rate, channels and so on)
  35. * and DRM related info (file encryption, content id).
  36. * - Sound data organized in packets follow the EA3 header
  37. * (can be encrypted using the Sony DRM!).
  38. *
  39. * Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM
  40. */
  41. #include <inttypes.h>
  42. #include "libavutil/channel_layout.h"
  43. #include "avformat.h"
  44. #include "internal.h"
  45. #include "libavutil/intreadwrite.h"
  46. #include "libavutil/des.h"
  47. #include "libavutil/mathematics.h"
  48. #include "oma.h"
  49. #include "pcm.h"
  50. #include "id3v2.h"
  51. static const uint64_t leaf_table[] = {
  52. 0xd79e8283acea4620, 0x7a9762f445afd0d8,
  53. 0x354d60a60b8c79f1, 0x584e1cde00b07aee,
  54. 0x1573cd93da7df623, 0x47f98d79620dd535
  55. };
  56. typedef struct OMAContext {
  57. uint64_t content_start;
  58. int encrypted;
  59. uint16_t k_size;
  60. uint16_t e_size;
  61. uint16_t i_size;
  62. uint16_t s_size;
  63. uint32_t rid;
  64. uint8_t r_val[24];
  65. uint8_t n_val[24];
  66. uint8_t m_val[8];
  67. uint8_t s_val[8];
  68. uint8_t sm_val[8];
  69. uint8_t e_val[8];
  70. uint8_t iv[8];
  71. struct AVDES *av_des;
  72. int (*read_packet)(AVFormatContext *s, AVPacket *pkt);
  73. } OMAContext;
  74. static int oma_read_close(AVFormatContext *s)
  75. {
  76. OMAContext *oc = s->priv_data;
  77. av_freep(&oc->av_des);
  78. return 0;
  79. }
  80. static void hex_log(AVFormatContext *s, int level,
  81. const char *name, const uint8_t *value, int len)
  82. {
  83. char buf[33];
  84. len = FFMIN(len, 16);
  85. if (av_log_get_level() < level)
  86. return;
  87. ff_data_to_hex(buf, value, len, 1);
  88. buf[len << 1] = '\0';
  89. av_log(s, level, "%s: %s\n", name, buf);
  90. }
  91. static int kset(AVFormatContext *s, const uint8_t *r_val, const uint8_t *n_val,
  92. int len)
  93. {
  94. OMAContext *oc = s->priv_data;
  95. if (!r_val && !n_val)
  96. return -1;
  97. len = FFMIN(len, 16);
  98. /* use first 64 bits in the third round again */
  99. if (r_val) {
  100. if (r_val != oc->r_val) {
  101. memset(oc->r_val, 0, 24);
  102. memcpy(oc->r_val, r_val, len);
  103. }
  104. memcpy(&oc->r_val[16], r_val, 8);
  105. }
  106. if (n_val) {
  107. if (n_val != oc->n_val) {
  108. memset(oc->n_val, 0, 24);
  109. memcpy(oc->n_val, n_val, len);
  110. }
  111. memcpy(&oc->n_val[16], n_val, 8);
  112. }
  113. return 0;
  114. }
  115. #define OMA_RPROBE_M_VAL 48 + 1
  116. static int rprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
  117. const uint8_t *r_val)
  118. {
  119. OMAContext *oc = s->priv_data;
  120. unsigned int pos;
  121. struct AVDES *av_des;
  122. if (!enc_header || !r_val ||
  123. size < OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size ||
  124. size < OMA_RPROBE_M_VAL)
  125. return -1;
  126. av_des = av_des_alloc();
  127. if (!av_des)
  128. return AVERROR(ENOMEM);
  129. /* m_val */
  130. av_des_init(av_des, r_val, 192, 1);
  131. av_des_crypt(av_des, oc->m_val, &enc_header[48], 1, NULL, 1);
  132. /* s_val */
  133. av_des_init(av_des, oc->m_val, 64, 0);
  134. av_des_crypt(av_des, oc->s_val, NULL, 1, NULL, 0);
  135. /* sm_val */
  136. pos = OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size;
  137. av_des_init(av_des, oc->s_val, 64, 0);
  138. av_des_mac(av_des, oc->sm_val, &enc_header[pos], (oc->i_size >> 3));
  139. pos += oc->i_size;
  140. av_free(av_des);
  141. return memcmp(&enc_header[pos], oc->sm_val, 8) ? -1 : 0;
  142. }
  143. static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
  144. const uint8_t *n_val)
  145. {
  146. OMAContext *oc = s->priv_data;
  147. uint64_t pos;
  148. uint32_t taglen, datalen;
  149. struct AVDES *av_des;
  150. if (!enc_header || !n_val ||
  151. size < OMA_ENC_HEADER_SIZE + oc->k_size + 4)
  152. return -1;
  153. pos = OMA_ENC_HEADER_SIZE + oc->k_size;
  154. if (!memcmp(&enc_header[pos], "EKB ", 4))
  155. pos += 32;
  156. if (size < pos + 44)
  157. return -1;
  158. if (AV_RB32(&enc_header[pos]) != oc->rid)
  159. av_log(s, AV_LOG_DEBUG, "Mismatching RID\n");
  160. taglen = AV_RB32(&enc_header[pos + 32]);
  161. datalen = AV_RB32(&enc_header[pos + 36]) >> 4;
  162. pos += 44LL + taglen;
  163. if (pos + (((uint64_t)datalen) << 4) > size)
  164. return -1;
  165. av_des = av_des_alloc();
  166. if (!av_des)
  167. return AVERROR(ENOMEM);
  168. av_des_init(av_des, n_val, 192, 1);
  169. while (datalen-- > 0) {
  170. av_des_crypt(av_des, oc->r_val, &enc_header[pos], 2, NULL, 1);
  171. kset(s, oc->r_val, NULL, 16);
  172. if (!rprobe(s, enc_header, size, oc->r_val)) {
  173. av_free(av_des);
  174. return 0;
  175. }
  176. pos += 16;
  177. }
  178. av_free(av_des);
  179. return -1;
  180. }
  181. static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
  182. {
  183. OMAContext *oc = s->priv_data;
  184. ID3v2ExtraMetaGEOB *geob = NULL;
  185. uint8_t *gdata;
  186. oc->encrypted = 1;
  187. av_log(s, AV_LOG_INFO, "File is encrypted\n");
  188. /* find GEOB metadata */
  189. for (; em; em = em->next) {
  190. if (strcmp(em->tag, "GEOB"))
  191. continue;
  192. geob = &em->data.geob;
  193. if (!strcmp(geob->description, "OMG_LSI") ||
  194. !strcmp(geob->description, "OMG_BKLSI"))
  195. break;
  196. }
  197. if (!em) {
  198. av_log(s, AV_LOG_ERROR, "No encryption header found\n");
  199. return AVERROR_INVALIDDATA;
  200. }
  201. if (geob->datasize < 64) {
  202. av_log(s, AV_LOG_ERROR,
  203. "Invalid GEOB data size: %"PRIu32"\n", geob->datasize);
  204. return AVERROR_INVALIDDATA;
  205. }
  206. gdata = geob->data;
  207. if (AV_RB16(gdata) != 1)
  208. av_log(s, AV_LOG_WARNING, "Unknown version in encryption header\n");
  209. oc->k_size = AV_RB16(&gdata[2]);
  210. oc->e_size = AV_RB16(&gdata[4]);
  211. oc->i_size = AV_RB16(&gdata[6]);
  212. oc->s_size = AV_RB16(&gdata[8]);
  213. if (memcmp(&gdata[OMA_ENC_HEADER_SIZE], "KEYRING ", 12)) {
  214. av_log(s, AV_LOG_ERROR, "Invalid encryption header\n");
  215. return AVERROR_INVALIDDATA;
  216. }
  217. if (OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size + 8 > geob->datasize ||
  218. OMA_ENC_HEADER_SIZE + 48 > geob->datasize) {
  219. av_log(s, AV_LOG_ERROR, "Too little GEOB data\n");
  220. return AVERROR_INVALIDDATA;
  221. }
  222. oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
  223. av_log(s, AV_LOG_DEBUG, "RID: %.8"PRIx32"\n", oc->rid);
  224. memcpy(oc->iv, &header[0x58], 8);
  225. hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8);
  226. hex_log(s, AV_LOG_DEBUG, "CBC-MAC",
  227. &gdata[OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size],
  228. 8);
  229. if (s->keylen > 0) {
  230. kset(s, s->key, s->key, s->keylen);
  231. }
  232. if (!memcmp(oc->r_val, (const uint8_t[8]){0}, 8) ||
  233. rprobe(s, gdata, geob->datasize, oc->r_val) < 0 &&
  234. nprobe(s, gdata, geob->datasize, oc->n_val) < 0) {
  235. int i;
  236. for (i = 0; i < FF_ARRAY_ELEMS(leaf_table); i += 2) {
  237. uint8_t buf[16];
  238. AV_WL64(buf, leaf_table[i]);
  239. AV_WL64(&buf[8], leaf_table[i + 1]);
  240. kset(s, buf, buf, 16);
  241. if (!rprobe(s, gdata, geob->datasize, oc->r_val) ||
  242. !nprobe(s, gdata, geob->datasize, oc->n_val))
  243. break;
  244. }
  245. if (i >= FF_ARRAY_ELEMS(leaf_table)) {
  246. av_log(s, AV_LOG_ERROR, "Invalid key\n");
  247. return AVERROR_INVALIDDATA;
  248. }
  249. }
  250. oc->av_des = av_des_alloc();
  251. if (!oc->av_des)
  252. return AVERROR(ENOMEM);
  253. /* e_val */
  254. av_des_init(oc->av_des, oc->m_val, 64, 0);
  255. av_des_crypt(oc->av_des, oc->e_val,
  256. &gdata[OMA_ENC_HEADER_SIZE + 40], 1, NULL, 0);
  257. hex_log(s, AV_LOG_DEBUG, "EK", oc->e_val, 8);
  258. /* init e_val */
  259. av_des_init(oc->av_des, oc->e_val, 64, 1);
  260. return 0;
  261. }
  262. static int read_packet(AVFormatContext *s, AVPacket *pkt)
  263. {
  264. OMAContext *oc = s->priv_data;
  265. AVStream *st = s->streams[0];
  266. int packet_size = st->codecpar->block_align;
  267. int byte_rate = st->codecpar->bit_rate >> 3;
  268. int64_t pos = avio_tell(s->pb);
  269. int ret = av_get_packet(s->pb, pkt, packet_size);
  270. if (ret < packet_size)
  271. pkt->flags |= AV_PKT_FLAG_CORRUPT;
  272. if (ret < 0)
  273. return ret;
  274. if (!ret)
  275. return AVERROR_EOF;
  276. pkt->stream_index = 0;
  277. if (pos >= oc->content_start && byte_rate > 0) {
  278. pkt->pts =
  279. pkt->dts = av_rescale(pos - oc->content_start, st->time_base.den,
  280. byte_rate * (int64_t)st->time_base.num);
  281. }
  282. if (oc->encrypted) {
  283. /* previous unencrypted block saved in IV for
  284. * the next packet (CBC mode) */
  285. if (ret == packet_size)
  286. av_des_crypt(oc->av_des, pkt->data, pkt->data,
  287. (packet_size >> 3), oc->iv, 1);
  288. else
  289. memset(oc->iv, 0, 8);
  290. }
  291. return ret;
  292. }
  293. static int aal_read_packet(AVFormatContext *s, AVPacket *pkt)
  294. {
  295. int64_t pos = avio_tell(s->pb);
  296. int ret, pts;
  297. int packet_size;
  298. unsigned tag;
  299. if (avio_feof(s->pb))
  300. return AVERROR_EOF;
  301. tag = avio_rb24(s->pb);
  302. if (tag == 0)
  303. return AVERROR_EOF;
  304. else if (tag != MKBETAG(0,'B','L','K'))
  305. return AVERROR_INVALIDDATA;
  306. avio_skip(s->pb, 1);
  307. packet_size = avio_rb16(s->pb);
  308. avio_skip(s->pb, 2);
  309. pts = avio_rb32(s->pb);
  310. avio_skip(s->pb, 12);
  311. ret = av_get_packet(s->pb, pkt, packet_size);
  312. if (ret < packet_size)
  313. pkt->flags |= AV_PKT_FLAG_CORRUPT;
  314. if (ret < 0)
  315. return ret;
  316. if (!ret)
  317. return AVERROR_EOF;
  318. pkt->stream_index = 0;
  319. pkt->pos = pos;
  320. if (s->streams[0]->codecpar->codec_id == AV_CODEC_ID_ATRAC3AL) {
  321. pkt->duration = 1024;
  322. pkt->pts = pts * 1024LL;
  323. } else {
  324. pkt->duration = 2048;
  325. pkt->pts = pts * 2048LL;
  326. }
  327. return ret;
  328. }
  329. static int oma_read_header(AVFormatContext *s)
  330. {
  331. int ret, framesize, jsflag, samplerate;
  332. uint32_t codec_params, channel_id;
  333. int16_t eid;
  334. uint8_t buf[EA3_HEADER_SIZE];
  335. uint8_t *edata;
  336. AVStream *st;
  337. ID3v2ExtraMeta *extra_meta = NULL;
  338. OMAContext *oc = s->priv_data;
  339. ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta, 0);
  340. if ((ret = ff_id3v2_parse_chapters(s, extra_meta)) < 0) {
  341. ff_id3v2_free_extra_meta(&extra_meta);
  342. return ret;
  343. }
  344. ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
  345. if (ret < EA3_HEADER_SIZE) {
  346. ff_id3v2_free_extra_meta(&extra_meta);
  347. return -1;
  348. }
  349. if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}), 3) ||
  350. buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
  351. ff_id3v2_free_extra_meta(&extra_meta);
  352. av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
  353. return AVERROR_INVALIDDATA;
  354. }
  355. oc->content_start = avio_tell(s->pb);
  356. /* encrypted file */
  357. eid = AV_RB16(&buf[6]);
  358. if (eid != -1 && eid != -128 && decrypt_init(s, extra_meta, buf) < 0) {
  359. ff_id3v2_free_extra_meta(&extra_meta);
  360. return -1;
  361. }
  362. ff_id3v2_free_extra_meta(&extra_meta);
  363. codec_params = AV_RB24(&buf[33]);
  364. st = avformat_new_stream(s, NULL);
  365. if (!st) {
  366. ret = AVERROR(ENOMEM);
  367. goto fail;
  368. }
  369. st->start_time = 0;
  370. st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
  371. st->codecpar->codec_tag = buf[32];
  372. st->codecpar->codec_id = ff_codec_get_id(ff_oma_codec_tags,
  373. st->codecpar->codec_tag);
  374. oc->read_packet = read_packet;
  375. switch (buf[32]) {
  376. case OMA_CODECID_ATRAC3:
  377. samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
  378. if (!samplerate) {
  379. av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
  380. ret = AVERROR_INVALIDDATA;
  381. goto fail;
  382. }
  383. if (samplerate != 44100)
  384. avpriv_request_sample(s, "Sample rate %d", samplerate);
  385. framesize = (codec_params & 0x3FF) * 8;
  386. /* get stereo coding mode, 1 for joint-stereo */
  387. jsflag = (codec_params >> 17) & 1;
  388. st->codecpar->channels = 2;
  389. st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
  390. st->codecpar->sample_rate = samplerate;
  391. st->codecpar->bit_rate = st->codecpar->sample_rate * framesize / (1024 / 8);
  392. /* fake the ATRAC3 extradata
  393. * (wav format, makes stream copy to wav work) */
  394. if ((ret = ff_alloc_extradata(st->codecpar, 14)) < 0)
  395. goto fail;
  396. edata = st->codecpar->extradata;
  397. AV_WL16(&edata[0], 1); // always 1
  398. AV_WL32(&edata[2], samplerate); // samples rate
  399. AV_WL16(&edata[6], jsflag); // coding mode
  400. AV_WL16(&edata[8], jsflag); // coding mode
  401. AV_WL16(&edata[10], 1); // always 1
  402. // AV_WL16(&edata[12], 0); // always 0
  403. avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
  404. break;
  405. case OMA_CODECID_ATRAC3P:
  406. channel_id = (codec_params >> 10) & 7;
  407. if (!channel_id) {
  408. av_log(s, AV_LOG_ERROR,
  409. "Invalid ATRAC-X channel id: %"PRIu32"\n", channel_id);
  410. ret = AVERROR_INVALIDDATA;
  411. goto fail;
  412. }
  413. st->codecpar->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1];
  414. st->codecpar->channels = ff_oma_chid_to_num_channels[channel_id - 1];
  415. framesize = ((codec_params & 0x3FF) * 8) + 8;
  416. samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
  417. if (!samplerate) {
  418. av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
  419. ret = AVERROR_INVALIDDATA;
  420. goto fail;
  421. }
  422. st->codecpar->sample_rate = samplerate;
  423. st->codecpar->bit_rate = samplerate * framesize / (2048 / 8);
  424. avpriv_set_pts_info(st, 64, 1, samplerate);
  425. break;
  426. case OMA_CODECID_MP3:
  427. st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
  428. framesize = 1024;
  429. break;
  430. case OMA_CODECID_LPCM:
  431. /* PCM 44.1 kHz 16 bit stereo big-endian */
  432. st->codecpar->channels = 2;
  433. st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
  434. st->codecpar->sample_rate = 44100;
  435. framesize = 1024;
  436. /* bit rate = sample rate x PCM block align (= 4) x 8 */
  437. st->codecpar->bit_rate = st->codecpar->sample_rate * 32;
  438. st->codecpar->bits_per_coded_sample =
  439. av_get_bits_per_sample(st->codecpar->codec_id);
  440. avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
  441. break;
  442. case OMA_CODECID_ATRAC3AL:
  443. st->codecpar->channels = 2;
  444. st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
  445. st->codecpar->sample_rate = 44100;
  446. avpriv_set_pts_info(st, 64, 1, 44100);
  447. oc->read_packet = aal_read_packet;
  448. framesize = 4096;
  449. break;
  450. case OMA_CODECID_ATRAC3PAL:
  451. st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
  452. st->codecpar->channels = 2;
  453. st->codecpar->sample_rate = 44100;
  454. avpriv_set_pts_info(st, 64, 1, 44100);
  455. oc->read_packet = aal_read_packet;
  456. framesize = 4096;
  457. break;
  458. default:
  459. av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n", buf[32]);
  460. ret = AVERROR(ENOSYS);
  461. goto fail;
  462. }
  463. st->codecpar->block_align = framesize;
  464. return 0;
  465. fail:
  466. oma_read_close(s);
  467. return ret;
  468. }
  469. static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
  470. {
  471. OMAContext *oc = s->priv_data;
  472. return oc->read_packet(s, pkt);
  473. }
  474. static int oma_read_probe(const AVProbeData *p)
  475. {
  476. const uint8_t *buf = p->buf;
  477. unsigned tag_len = 0;
  478. if (p->buf_size >= ID3v2_HEADER_SIZE && ff_id3v2_match(buf, ID3v2_EA3_MAGIC))
  479. tag_len = ff_id3v2_tag_len(buf);
  480. /* This check cannot overflow as tag_len has at most 28 bits */
  481. if (p->buf_size < tag_len + 5)
  482. /* EA3 header comes late, might be outside of the probe buffer */
  483. return tag_len ? AVPROBE_SCORE_EXTENSION/2 : 0;
  484. buf += tag_len;
  485. if (!memcmp(buf, "EA3", 3) && !buf[4] && buf[5] == EA3_HEADER_SIZE)
  486. return AVPROBE_SCORE_MAX;
  487. else
  488. return 0;
  489. }
  490. static int oma_read_seek(struct AVFormatContext *s,
  491. int stream_index, int64_t timestamp, int flags)
  492. {
  493. OMAContext *oc = s->priv_data;
  494. AVStream *st = s->streams[0];
  495. int64_t err;
  496. if (st->codecpar->codec_id == AV_CODEC_ID_ATRAC3PAL ||
  497. st->codecpar->codec_id == AV_CODEC_ID_ATRAC3AL)
  498. return -1;
  499. err = ff_pcm_read_seek(s, stream_index, timestamp, flags);
  500. if (!oc->encrypted)
  501. return err;
  502. /* readjust IV for CBC */
  503. if (err || avio_tell(s->pb) < oc->content_start)
  504. goto wipe;
  505. if ((err = avio_seek(s->pb, -8, SEEK_CUR)) < 0)
  506. goto wipe;
  507. if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {
  508. if (err >= 0)
  509. err = AVERROR_EOF;
  510. goto wipe;
  511. }
  512. return 0;
  513. wipe:
  514. memset(oc->iv, 0, 8);
  515. return err;
  516. }
  517. AVInputFormat ff_oma_demuxer = {
  518. .name = "oma",
  519. .long_name = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
  520. .priv_data_size = sizeof(OMAContext),
  521. .read_probe = oma_read_probe,
  522. .read_header = oma_read_header,
  523. .read_packet = oma_read_packet,
  524. .read_seek = oma_read_seek,
  525. .read_close = oma_read_close,
  526. .flags = AVFMT_GENERIC_INDEX,
  527. .extensions = "oma,omg,aa3",
  528. .codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
  529. };