diff --git a/ffplay.c b/ffplay.c
index 301dec65618691eb6c21fc22d8bf9b2967f4b19a..779c87967ad8eb07c68d42b823787d78c60c36e6 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1839,8 +1839,13 @@ static int video_thread(void *arg)
     int last_w = is->video_st->codec->width;
     int last_h = is->video_st->codec->height;
 
-    if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
+    if ((ret = configure_video_filters(graph, is, vfilters)) < 0) {
+        SDL_Event event;
+        event.type = FF_QUIT_EVENT;
+        event.user.data1 = is;
+        SDL_PushEvent(&event);
         goto the_end;
+    }
     filt_out = is->out_video_filter;
 #endif