diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 4d7fdb632ad624409db585fd40a1b4744c635164..bcc710941ed5a83a8c5464d7e0ca95b9af2b507e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -827,7 +827,7 @@ static void rtsp_send_cmd(AVFormatContext *s,
 #endif
     url_write(rt->rtsp_hd, buf, strlen(buf));
 
-    rtsp_read_reply(rt, reply, content_ptr);
+    rtsp_read_reply(s, reply, content_ptr);
 }