summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-10-04 12:04:41 -0400
committerMarton Balint <cus@passwd.hu>2015-10-05 00:16:42 +0200
commit7c6dd90eed48bf4eaec6a576dc6a3078337c8d27 (patch)
tree4323b8fadb82aa91b7a940b85922d3da7d5837f2 /ffplay.c
parent80b6cc4214a8d90e50ebb49ff1088c3223d2c680 (diff)
downloadffmpeg-7c6dd90eed48bf4eaec6a576dc6a3078337c8d27.tar.gz
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@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index c5a7895201..3223cebf98 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;