diff --git a/libavdevice/alsa-audio-enc.c b/libavdevice/alsa-audio-enc.c
index 7d3107accaa653ad14071823034cca9110587998..901af8b19b7b6a4d259bfa0f2c425104f04f50b2 100644
--- a/libavdevice/alsa-audio-enc.c
+++ b/libavdevice/alsa-audio-enc.c
@@ -47,7 +47,7 @@ av_cold static int audio_write_header(AVFormatContext *s1)
     AlsaData *s = s1->priv_data;
     AVStream *st;
     unsigned int sample_rate;
-    int codec_id;
+    enum CodecID codec_id;
     int res;
 
     st = s1->streams[0];