ffplay: allow fallback to software renderer
authorMarton Balint <cus@passwd.hu>
Thu, 17 Nov 2016 21:10:34 +0000 (22:10 +0100)
committerMarton Balint <cus@passwd.hu>
Sun, 20 Nov 2016 22:38:06 +0000 (23:38 +0100)
Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay.c

index 12502f2..bb781a2 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1282,6 +1282,10 @@ static int video_open(VideoState *is, Frame *vp)
         if (window) {
             SDL_RendererInfo info;
             renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
+            if (!renderer) {
+                av_log(NULL, AV_LOG_WARNING, "Failed to initialize a hardware accelerated renderer: %s\n", SDL_GetError());
+                renderer = SDL_CreateRenderer(window, -1, 0);
+            }
             if (renderer) {
                 if (!SDL_GetRendererInfo(renderer, &info))
                     av_log(NULL, AV_LOG_VERBOSE, "Initialized %s renderer.\n", info.name);