diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 794a7754dbfedf0eeedd7f8d83308f2e24d7e1cb..c3291cfbd418b2ef86a0702d21f2ebcee16a1bcb 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -174,7 +174,7 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t serial)
     struct ogg_stream *os;
     unsigned bufsize;
     uint8_t *buf;
-    struct ogg_codec *codec;
+    const struct ogg_codec *codec;
 
     if (ogg->nstreams != 1) {
         av_log_missing_feature(s, "Changing stream parameters in multistream ogg", 0);