mirror of https://git.ffmpeg.org/ffmpeg.git
ffplay: log SDL error messages
This logs the SDL error messages on failure of creation of SDL_CreateMutex, SDL_CreateCond, and SDL_CreateThread. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
1d4af04adf
commit
4802b8368a
13
ffplay.c
13
ffplay.c
|
@ -657,10 +657,14 @@ static int frame_queue_init(FrameQueue *f, PacketQueue *pktq, int max_size, int
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
memset(f, 0, sizeof(FrameQueue));
|
memset(f, 0, sizeof(FrameQueue));
|
||||||
if (!(f->mutex = SDL_CreateMutex()))
|
if (!(f->mutex = SDL_CreateMutex())) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
if (!(f->cond = SDL_CreateCond()))
|
}
|
||||||
|
if (!(f->cond = SDL_CreateCond())) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError());
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
f->pktq = pktq;
|
f->pktq = pktq;
|
||||||
f->max_size = FFMIN(max_size, FRAME_QUEUE_SIZE);
|
f->max_size = FFMIN(max_size, FRAME_QUEUE_SIZE);
|
||||||
f->keep_last = !!keep_last;
|
f->keep_last = !!keep_last;
|
||||||
|
@ -3175,6 +3179,7 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
|
||||||
is->av_sync_type = av_sync_type;
|
is->av_sync_type = av_sync_type;
|
||||||
is->read_tid = SDL_CreateThread(read_thread, is);
|
is->read_tid = SDL_CreateThread(read_thread, is);
|
||||||
if (!is->read_tid) {
|
if (!is->read_tid) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "SDL_CreateThread(): %s\n", SDL_GetError());
|
||||||
fail:
|
fail:
|
||||||
stream_close(is);
|
stream_close(is);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -3726,8 +3731,10 @@ static int lockmgr(void **mtx, enum AVLockOp op)
|
||||||
switch(op) {
|
switch(op) {
|
||||||
case AV_LOCK_CREATE:
|
case AV_LOCK_CREATE:
|
||||||
*mtx = SDL_CreateMutex();
|
*mtx = SDL_CreateMutex();
|
||||||
if(!*mtx)
|
if(!*mtx) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case AV_LOCK_OBTAIN:
|
case AV_LOCK_OBTAIN:
|
||||||
return !!SDL_LockMutex(*mtx);
|
return !!SDL_LockMutex(*mtx);
|
||||||
|
|
Loading…
Reference in New Issue