av_log(s, AV_LOG_INFO, "File is encrypted\n");
/* find GEOB metadata */
- while (em) {
- if (!strcmp(em->tag, "GEOB") &&
- (geob = em->data) &&
- (!strcmp(geob->description, "OMG_LSI") ||
- !strcmp(geob->description, "OMG_BKLSI"))) {
+ for (; em; em = em->next) {
+ if (strcmp(em->tag, "GEOB"))
+ continue;
+ geob = &em->data.geob;
+ if (!strcmp(geob->description, "OMG_LSI") ||
+ !strcmp(geob->description, "OMG_BKLSI"))
break;
- }
- em = em->next;
}
if (!em) {
av_log(s, AV_LOG_ERROR, "No encryption header found\n");
OMAContext *oc = s->priv_data;
ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta, 0);
- if ((ret = ff_id3v2_parse_chapters(s, &extra_meta)) < 0) {
+ if ((ret = ff_id3v2_parse_chapters(s, extra_meta)) < 0) {
ff_id3v2_free_extra_meta(&extra_meta);
return ret;
}
/* fake the ATRAC3 extradata
* (wav format, makes stream copy to wav work) */
- if (ff_alloc_extradata(st->codecpar, 14))
- return AVERROR(ENOMEM);
+ if ((ret = ff_alloc_extradata(st->codecpar, 14)) < 0)
+ return ret;
edata = st->codecpar->extradata;
AV_WL16(&edata[0], 1); // always 1
return oc->read_packet(s, pkt);
}
-static int oma_read_probe(AVProbeData *p)
+static int oma_read_probe(const AVProbeData *p)
{
const uint8_t *buf = p->buf;
unsigned tag_len = 0;