]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/westwood_vqa.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavformat / westwood_vqa.c
index c21a3e31f65d2b6356168dcf2ec93cf4754869ca..77df007c110ce4960b7fded5bc3f8abc1e22592d 100644 (file)
@@ -85,7 +85,7 @@ static int wsvqa_read_header(AVFormatContext *s)
     uint8_t scratch[VQA_PREAMBLE_SIZE];
     uint32_t chunk_tag;
     uint32_t chunk_size;
-    int fps;
+    int fps, ret;
 
     /* initialize the video decoder stream */
     st = avformat_new_stream(s, NULL);
@@ -101,8 +101,8 @@ static int wsvqa_read_header(AVFormatContext *s)
     avio_seek(pb, 20, SEEK_SET);
 
     /* the VQA header needs to go to the decoder */
-    if (ff_get_extradata(s, st->codecpar, pb, VQA_HEADER_SIZE) < 0)
-        return AVERROR(ENOMEM);
+    if ((ret = ff_get_extradata(s, st->codecpar, pb, VQA_HEADER_SIZE)) < 0)
+        return ret;
     header = st->codecpar->extradata;
     st->codecpar->width = AV_RL16(&header[6]);
     st->codecpar->height = AV_RL16(&header[8]);
@@ -214,8 +214,8 @@ static int wsvqa_read_packet(AVFormatContext *s,
                         break;
                     case SND2_TAG:
                         st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_WS;
-                        if (ff_alloc_extradata(st->codecpar, 2))
-                            return AVERROR(ENOMEM);
+                        if ((ret = ff_alloc_extradata(st->codecpar, 2)) < 0)
+                            return ret;
                         AV_WL16(st->codecpar->extradata, wsvqa->version);
                         break;
                     }
@@ -260,7 +260,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
     return ret;
 }
 
-AVInputFormat ff_wsvqa_demuxer = {
+const AVInputFormat ff_wsvqa_demuxer = {
     .name           = "wsvqa",
     .long_name      = NULL_IF_CONFIG_SMALL("Westwood Studios VQA"),
     .priv_data_size = sizeof(WsVqaDemuxContext),