[FFmpeg-cvslog] ffplay: more robust mutex creation

Ganesh Ajjanagadde git at videolan.org
Mon Oct 5 00:42:47 CEST 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Sun Oct  4 12:04:41 2015 -0400| [7c6dd90eed48bf4eaec6a576dc6a3078337c8d27] | committer: Marton Balint

ffplay: more robust mutex creation

SDL_CreateMutex can fail:
https://wiki.libsdl.org/SDL_CreateMutex.
This patch makes creation more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c6dd90eed48bf4eaec6a576dc6a3078337c8d27
---

 ffplay.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index c5a7895..3223ceb 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2817,6 +2817,12 @@ static int read_thread(void *arg)
     int scan_all_pmts_set = 0;
     int64_t pkt_ts;
 
+    if (!wait_mutex) {
+        av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
+        ret = AVERROR(ENOMEM);
+        goto fail;
+    }
+
     memset(st_index, -1, sizeof(st_index));
     is->last_video_stream = is->video_stream = -1;
     is->last_audio_stream = is->audio_stream = -1;



More information about the ffmpeg-cvslog mailing list