]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/sdsdec.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavformat / sdsdec.c
index 081bb4ca2d8740e73f1a747b69f7648087710862..073dadafbb951332853d1c10ca672b81fca6346f 100644 (file)
@@ -30,7 +30,7 @@ typedef struct SDSContext {
     void (*read_block)(const uint8_t *src, uint32_t *dst);
 } SDSContext;
 
-static int sds_probe(AVProbeData *p)
+static int sds_probe(const AVProbeData *p)
 {
     if (AV_RB32(p->buf) == 0xF07E0001 && p->buf[20] == 0xF7 &&
         p->buf[6] >= 8 && p->buf[6] <= 28)
@@ -43,7 +43,7 @@ static void byte2_read(const uint8_t *src, uint32_t *dst)
     int i;
 
     for (i = 0; i < 120; i += 2) {
-        unsigned sample = (src[i + 0] << 25) + (src[i + 1] << 18);
+        unsigned sample = ((unsigned)src[i + 0] << 25) + ((unsigned)src[i + 1] << 18);
 
         dst[i / 2] = sample;
     }
@@ -56,7 +56,7 @@ static void byte3_read(const uint8_t *src, uint32_t *dst)
     for (i = 0; i < 120; i += 3) {
         unsigned sample;
 
-        sample = (src[i + 0] << 25) | (src[i + 1] << 18) | (src[i + 2] << 11);
+        sample = ((unsigned)src[i + 0] << 25) | ((unsigned)src[i + 1] << 18) | ((unsigned)src[i + 2] << 11);
         dst[i / 3] = sample;
     }
 }
@@ -68,7 +68,7 @@ static void byte4_read(const uint8_t *src, uint32_t *dst)
     for (i = 0; i < 120; i += 4) {
         unsigned sample;
 
-        sample = (src[i + 0] << 25) | (src[i + 1] << 18) | (src[i + 2] << 11) | (src[i + 3] << 4);
+        sample = ((unsigned)src[i + 0] << 25) | ((unsigned)src[i + 1] << 18) | ((unsigned)src[i + 2] << 11) | ((unsigned)src[i + 3] << 4);
         dst[i / 4] = sample;
     }
 }
@@ -153,7 +153,7 @@ static int sds_read_packet(AVFormatContext *ctx, AVPacket *pkt)
     return ret;
 }
 
-AVInputFormat ff_sds_demuxer = {
+const AVInputFormat ff_sds_demuxer = {
     .name           = "sds",
     .long_name      = NULL_IF_CONFIG_SMALL("MIDI Sample Dump Standard"),
     .priv_data_size = sizeof(SDSContext),