diff --git a/libavformat/tty.c b/libavformat/tty.c
index 0adbaf1f11a65d3898b4ca9d8283a3b093870186..1003157ee0aa2c8a2c78087f70d51b45cc5996b7 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -120,7 +120,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
     pkt->size = av_get_packet(avctx->pb, pkt, n);
     if (pkt->size <= 0)
         return AVERROR(EIO);
-    pkt->flags |= PKT_FLAG_KEY;
+    pkt->flags |= AV_PKT_FLAG_KEY;
     return 0;
 }