]> git.sesse.net Git - ffmpeg/commitdiff
avformat/async: Use AVERROR macro
authorLimin Wang <lance.lmwang@gmail.com>
Sat, 16 Jan 2021 01:32:13 +0000 (09:32 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Thu, 21 Jan 2021 23:40:29 +0000 (07:40 +0800)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
libavformat/async.c

index a0bdfa2ee3ae69840b516383bf4a27a0fd892295..cc11ec47a07c5d929013d9306096a50db3a5826e 100644 (file)
@@ -262,24 +262,28 @@ static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **
 
     ret = pthread_mutex_init(&c->mutex, NULL);
     if (ret != 0) {
+        ret = AVERROR(ret);
         av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", av_err2str(ret));
         goto mutex_fail;
     }
 
     ret = pthread_cond_init(&c->cond_wakeup_main, NULL);
     if (ret != 0) {
+        ret = AVERROR(ret);
         av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
         goto cond_wakeup_main_fail;
     }
 
     ret = pthread_cond_init(&c->cond_wakeup_background, NULL);
     if (ret != 0) {
+        ret = AVERROR(ret);
         av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
         goto cond_wakeup_background_fail;
     }
 
     ret = pthread_create(&c->async_buffer_thread, NULL, async_buffer_task, h);
     if (ret) {
+        ret = AVERROR(ret);
         av_log(h, AV_LOG_ERROR, "pthread_create failed : %s\n", av_err2str(ret));
         goto thread_fail;
     }