diff --git a/ffserver.c b/ffserver.c
index 7719c7a8dac858137b77919904cf69fc8b95aea0..421773507791911d309648670a08a342b764175b 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3381,7 +3381,6 @@ static int rtp_new_av_stream(HTTPContext *c,
     st = av_mallocz(sizeof(AVStream));
     if (!st)
         goto fail;
-    st->codec= avcodec_alloc_context();
     ctx->nb_streams = 1;
     ctx->streams[0] = st;