[FFmpeg-devel] [PATCH] ffplay: log possible error of SDL_EnableKeyRepeat

Ganesh Ajjanagadde gajjanagadde at gmail.com
Fri Oct 9 00:46:44 CEST 2015


Note that for the current SDL source code, 0 is always returned.
Nevertheless, this makes the code more robust.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 ffplay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 79f430d..c143e96 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3814,7 +3814,8 @@ int main(int argc, char **argv)
     SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
     SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
 
-    SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
+    if (SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL) < 0)
+        av_log(NULL, AV_LOG_ERROR, "SDL_EnableKeyRepeat(): %s\n", SDL_GetError());
 
     if (av_lockmgr_register(lockmgr)) {
         av_log(NULL, AV_LOG_FATAL, "Could not initialize lock manager!\n");
-- 
2.6.1



More information about the ffmpeg-devel mailing list