int readvid;
}DXAContext;
-static int dxa_probe(AVProbeData *p)
+static int dxa_probe(const AVProbeData *p)
{
int w, h;
if (p->buf_size < 15)
c->readvid = !c->has_sound;
c->vidpos = avio_tell(pb);
s->start_time = 0;
- s->duration = (int64_t)c->frames * AV_TIME_BASE * num / den;
+ s->duration = av_rescale(c->frames, AV_TIME_BASE * (int64_t)num, den);
av_log(s, AV_LOG_DEBUG, "%d frame(s)\n",c->frames);
return 0;
tag = AV_RL32(buf);
switch (tag) {
case MKTAG('N', 'U', 'L', 'L'):
- if(av_new_packet(pkt, 4 + pal_size) < 0)
- return AVERROR(ENOMEM);
+ if ((ret = av_new_packet(pkt, 4 + pal_size)) < 0)
+ return ret;
pkt->stream_index = 0;
if(pal_size) memcpy(pkt->data, pal, pal_size);
memcpy(pkt->data + pal_size, buf, 4);
size);
return AVERROR_INVALIDDATA;
}
- if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0)
- return AVERROR(ENOMEM);
+ ret = av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size);
+ if (ret < 0)
+ return ret;
memcpy(pkt->data + pal_size, buf, DXA_EXTRA_SIZE);
ret = avio_read(s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size);
if(ret != size){
- av_packet_unref(pkt);
return AVERROR(EIO);
}
if(pal_size) memcpy(pkt->data, pal, pal_size);
return AVERROR_EOF;
}
-AVInputFormat ff_dxa_demuxer = {
+const AVInputFormat ff_dxa_demuxer = {
.name = "dxa",
.long_name = NULL_IF_CONFIG_SMALL("DXA"),
.priv_data_size = sizeof(DXAContext),