From patchwork Fri Apr 10 19:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stebbins X-Patchwork-Id: 18820 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 DD87344A253 for ; Fri, 10 Apr 2020 22:04:41 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C868268B56C; Fri, 10 Apr 2020 22:04:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.jetheaddev.com (mail.jetheaddev.com [70.164.99.34]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE0E668B2B1 for ; Fri, 10 Apr 2020 22:04:35 +0300 (EEST) Received: from creator.alpe-d-promontory.fun (192.168.13.165) by cas.jetheaddev.com (192.168.13.27) with Microsoft SMTP Server (TLS) id 14.3.351.0; Fri, 10 Apr 2020 12:04:34 -0700 From: John Stebbins To: Date: Fri, 10 Apr 2020 13:02:21 -0600 Message-ID: <20200410190223.134413-6-jstebbins@jetheaddev.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200410190223.134413-1-jstebbins@jetheaddev.com> References: <20200410190223.134413-1-jstebbins@jetheaddev.com> MIME-Version: 1.0 X-Originating-IP: [192.168.13.165] Subject: [FFmpeg-devel] [PATCH 5/7] lavc/srtenc: return more meaninful error codes 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/srtenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c index 34f0f0d5e6..655b65679e 100644 --- a/libavcodec/srtenc.c +++ b/libavcodec/srtenc.c @@ -241,7 +241,7 @@ static int encode_frame(AVCodecContext *avctx, if (sub->rects[i]->type != SUBTITLE_ASS) { av_log(avctx, AV_LOG_ERROR, "Only SUBTITLE_ASS type supported.\n"); - return AVERROR(ENOSYS); + return AVERROR(EINVAL); } #if FF_API_ASS_TIMING @@ -276,7 +276,7 @@ static int encode_frame(AVCodecContext *avctx, if (s->buffer.len > bufsize) { av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n"); - return -1; + return AVERROR_BUFFER_TOO_SMALL; } memcpy(buf, s->buffer.str, s->buffer.len);