From patchwork Thu Jan 14 15:29:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 24944 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 186CA447FC2 for ; Thu, 14 Jan 2021 17:29:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CEBD368A29C; Thu, 14 Jan 2021 17:29:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CF9016806DC for ; Thu, 14 Jan 2021 17:29:24 +0200 (EET) Received: by mail-pl1-f180.google.com with SMTP id d4so3070968plh.5 for ; Thu, 14 Jan 2021 07:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=OpgEQ4DhWY8e18cX23YGvvvti75dT97TfugXT9eJUo0=; b=aA1BmS71oUfMub0Fy3XOyeHmHhqkJM6KgYth/mJMZ86kQeQjUTRKaFDD2ayCcDcp59 X7zI+t/niubyTzCZDwV6gRQf/nfi7hY8ybqGI+gDY2iyUV6ExzFCKbsWrg+4DLDahPK1 EzKSh+lqEG0JfeKD4ldkwpcL8/OoVir0vVBliAMaFHCh8a5FZr1HCmNMbh8WS9VtSX/9 cI+q+EN8W3DLxGfZyaKaQhLzvOroxvO4qOsbiYPzDPdsQ3SOquB0NM3u1PTjVusfTsaQ wOSoEYa6TaJXx6wmh17ucmXwo4NmaPNOACxF8xRoB9VyTTlZPi8R1D+RwrlQZeAOLMba E/TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OpgEQ4DhWY8e18cX23YGvvvti75dT97TfugXT9eJUo0=; b=MzBtyT7ehwIQjciMRjiW/xcwEAw3nxF1JthPXav4iaF3aqFN3noOd0nm9XfzuR6qhu 1FblWx5plqlp7NGfBuGmaVfl66rlKcUN6o5x13Ea0z5+uYVEfwkwleQ00DP1jYjcA7dv Sej/y1lJ2vSZ+8JzzksrWWypRXp/UHSlp7UiQ9gDWX91oTAoHz0xqLLbUNoGaMIQIEV4 d8tYTV6L9PgZ3J8tEmJr+m2koLv2fWyO+LisABPGd+xr/UHxY9QykcArrW+5eeKH/lPC eAguiGWq3X1GwjS/LfDgtg0Xm6ygQ1X4gPssylZC13C1xEn4rO2LFX+GnJfBCbnEepVS GXKA== X-Gm-Message-State: AOAM533I+RNZOg1J0ExbaQ8Qp0Nn1Etgx/jQ5YHc2BBFecoOpsDkm5Qn bD0uzyGxm4Hfce1QT5Qs49fjd/IlQf0= X-Google-Smtp-Source: ABdhPJxKyDMaIi0zgfqKZQYXp88pQm/5hJXqbnvuTeycMO6XCSqVgLhMfvnqX/7G8j2AhCUAreEBPA== X-Received: by 2002:a17:90a:5308:: with SMTP id x8mr5434361pjh.151.1610638162856; Thu, 14 Jan 2021 07:29:22 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c199sm5898011pfb.108.2021.01.14.07.29.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jan 2021 07:29:22 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 14 Jan 2021 23:29:18 +0800 Message-Id: <1610638158-16500-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH] avformat/async: Use the correct return values X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/async.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/async.c b/libavformat/async.c index a0bdfa2..801b20e 100644 --- a/libavformat/async.c +++ b/libavformat/async.c @@ -263,24 +263,28 @@ static int async_open(URLContext *h, const char *arg, int flags, AVDictionary ** ret = pthread_mutex_init(&c->mutex, NULL); if (ret != 0) { av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", av_err2str(ret)); + ret = AVERROR(ret); goto mutex_fail; } ret = pthread_cond_init(&c->cond_wakeup_main, NULL); if (ret != 0) { av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret)); + ret = AVERROR(ret); goto cond_wakeup_main_fail; } ret = pthread_cond_init(&c->cond_wakeup_background, NULL); if (ret != 0) { av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret)); + ret = AVERROR(ret); goto cond_wakeup_background_fail; } ret = pthread_create(&c->async_buffer_thread, NULL, async_buffer_task, h); if (ret) { av_log(h, AV_LOG_ERROR, "pthread_create failed : %s\n", av_err2str(ret)); + ret = AVERROR(ret); goto thread_fail; }