]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/apc.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavformat / apc.c
index 835d1b0f6e628f984f880d2bba61f44bf5db1769..56151bb59a2953a025e79dafbb8f69df93008d9d 100644 (file)
@@ -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,