diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index 70306b1f5ab70b948dc41c5471afb0165b07a0ae..11be2ac1c08b5bb91f3c8ee4e952204c68ae5d3b 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -193,8 +193,6 @@ static int ffm_write_header(AVFormatContext *s)
 
 static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    FFMContext *ffm = s->priv_data;
-    AVStream *st = s->streams[pkt->stream_index];
     int64_t pts;
     uint8_t header[FRAME_HEADER_SIZE];
     int header_size = FRAME_HEADER_SIZE;