} RoqDemuxContext;
-static int roq_probe(AVProbeData *p)
+static int roq_probe(const AVProbeData *p)
{
if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) ||
(AV_RL32(&p->buf[2]) != 0xFFFFFFFF))
}
/* load up the packet */
- if (av_new_packet(pkt, chunk_size + RoQ_CHUNK_PREAMBLE_SIZE))
- return AVERROR(EIO);
+ ret = av_new_packet(pkt, chunk_size + RoQ_CHUNK_PREAMBLE_SIZE);
+ if (ret < 0)
+ return ret;
/* copy over preamble */
memcpy(pkt->data, preamble, RoQ_CHUNK_PREAMBLE_SIZE);
ret = avio_read(pb, pkt->data + RoQ_CHUNK_PREAMBLE_SIZE,
chunk_size);
if (ret != chunk_size) {
- av_packet_unref(pkt);
- ret = AVERROR(EIO);
+ return AVERROR(EIO);
}
packet_read = 1;
return ret;
}
-AVInputFormat ff_roq_demuxer = {
+const AVInputFormat ff_roq_demuxer = {
.name = "roq",
.long_name = NULL_IF_CONFIG_SMALL("id RoQ"),
.priv_data_size = sizeof(RoqDemuxContext),