[FFmpeg-devel] [PATCH] ffplay: log SDL error message

Ganesh Ajjanagadde gajjanagadde at gmail.com
Sun Oct 4 18:28:25 CEST 2015


On Sun, Oct 4, 2015 at 12:16 PM, Ganesh Ajjanagadde
<gajjanagadde at gmail.com> wrote:
> This patch logs the SDL error message on failure of creation of SDL_CreateMutex, SDL_CreateCond.
>
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  ffplay.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/ffplay.c b/ffplay.c
> index 84bd6ee..39a1cbe 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -657,10 +657,14 @@ static int frame_queue_init(FrameQueue *f, PacketQueue *pktq, int max_size, int
>  {
>      int i;
>      memset(f, 0, sizeof(FrameQueue));
> -    if (!(f->mutex = SDL_CreateMutex()))
> +    if (!(f->mutex = SDL_CreateMutex())) {
> +        av_log(f, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
>          return AVERROR(ENOMEM);
> -    if (!(f->cond = SDL_CreateCond()))
> +    }
> +    if (!(f->cond = SDL_CreateCond())) {
> +        av_log(f, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError());
>          return AVERROR(ENOMEM);
> +    }
>      f->pktq = pktq;
>      f->max_size = FFMIN(max_size, FRAME_QUEUE_SIZE);
>      f->keep_last = !!keep_last;
> --
> 2.6.0
>

Commit message: "of creation of" -> "of". I can submit updated patch
for this if desired.


More information about the ffmpeg-devel mailing list