X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fapc.c;h=56151bb59a2953a025e79dafbb8f69df93008d9d;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=b180a50c9bd01e20476b2a12bd7e39793baede8d;hpb=a12063b118ad05409ff775ba30fab00265ad3031;p=ffmpeg diff --git a/libavformat/apc.c b/libavformat/apc.c index b180a50c9bd..56151bb59a2 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -25,7 +25,7 @@ #include "avformat.h" #include "internal.h" -static int apc_probe(AVProbeData *p) +static int apc_probe(const AVProbeData *p) { if (!strncmp(p->buf, "CRYO_APC", 8)) return AVPROBE_SCORE_MAX; @@ -37,6 +37,7 @@ static int apc_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; + int ret; avio_rl32(pb); /* CRYO */ avio_rl32(pb); /* _APC */ @@ -53,8 +54,8 @@ static int apc_read_header(AVFormatContext *s) st->codecpar->sample_rate = avio_rl32(pb); /* initial predictor values for adpcm decoder */ - if (ff_get_extradata(s, st->codecpar, pb, 2 * 4) < 0) - return AVERROR(ENOMEM); + if ((ret = ff_get_extradata(s, st->codecpar, pb, 2 * 4)) < 0) + return ret; if (avio_rl32(pb)) { st->codecpar->channels = 2; @@ -78,12 +79,11 @@ static int apc_read_packet(AVFormatContext *s, AVPacket *pkt) { if (av_get_packet(s->pb, pkt, MAX_READ_SIZE) <= 0) return AVERROR(EIO); - pkt->flags &= ~AV_PKT_FLAG_CORRUPT; pkt->stream_index = 0; return 0; } -AVInputFormat ff_apc_demuxer = { +const AVInputFormat ff_apc_demuxer = { .name = "apc", .long_name = NULL_IF_CONFIG_SMALL("CRYO APC"), .read_probe = apc_probe,