From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 7E5284B473
	for <ffmpegdev@gitmailbox.com>; Fri, 25 Apr 2025 08:06:11 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 18D7D687DE4;
	Fri, 25 Apr 2025 11:06:06 +0300 (EEST)
Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com
 [209.85.167.53])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BDAB3687D78
 for <ffmpeg-devel@ffmpeg.org>; Fri, 25 Apr 2025 11:05:59 +0300 (EEST)
Received: by mail-lf1-f53.google.com with SMTP id
 2adb3069b0e04-54e6788d07eso3291093e87.1
 for <ffmpeg-devel@ffmpeg.org>; Fri, 25 Apr 2025 01:05:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=martin-st.20230601.gappssmtp.com; s=20230601; t=1745568359; x=1746173159;
 darn=ffmpeg.org; 
 h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
 :date:from:to:cc:subject:date:message-id:reply-to;
 bh=qLBg9j6R0k/hdYfgesenpqNHmMJBlFxL8xYF9dFmbAc=;
 b=gIDd/0HUDTUL6NCFnMLvo8lmOR/8D1h6NBByIcn0ea22zoxkkEXaIGTFCOKULioVgT
 FlPmzGWRC5oPc8QNsQl71aEKoaUV9rUU738ozXiVFMMccbt8BBp19l+0p2lgzOP16K1A
 LHlfWAO2UiQ/5EJRVzRy34X0u+7JdMPhzzdSDfIcwxWHscRchcR7VeSG5iM1PG6cHb2/
 TrO4mDArhzM/MPdOavR0Vk80tCpZzNNRr/SCUVoo5PCcZArWLQXUvbV0VIWCjjNTKTof
 esv/+KrhP8OMM3oyUC8RKtui3+GXffUvTqAYXXoHEDtTdWU5mJ9Wfbz9cvpgnEwSSRZl
 LAvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1745568359; x=1746173159;
 h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
 :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=qLBg9j6R0k/hdYfgesenpqNHmMJBlFxL8xYF9dFmbAc=;
 b=wUeUwE/S1iKReixVMT0Nj1rpBDnjTFBQcwwBfWex7gd615bz4ltCfgk5Z8ae1Z2/Vb
 ML3MtDNeuZ6m6xNyjtFnDjzpD2QFyPSav85xYfNIBQbZUuUMgkJYmb+aYlkaoCZg53ol
 WANIisX5tSapk7zgdoHhL+A+zV8eaCS764qAOLZ2HfMnBuYdzkG8w9TWxodmUKWRaJY1
 YJ85Pp8bJHEgLTSUUZAk9iZ3tlKTaNfww/EjxO6w16RR+XWJryC7LIg9pwLLgkhI+uOD
 wQ5yzol+8F//CQ245iUtUfDgBRH+/7Ql0KCyaT7TmvfCaEgpldZsxfhJI5UNeZlnF4BP
 LcKw==
X-Gm-Message-State: AOJu0Yw9UREHfqLeKwiD5wehiQR/uTdFFYSc1Km2qnbnsxlZGwXFM90C
 vafXFw8wgAx2rtjJK8Zam3VzVU/r19u93eUem3WyBip88F3e6Ccz8VkjKlAGNw==
X-Gm-Gg: ASbGncvZtc6uD+dxM8Bnj5liV5Zay4G2QxAtlZYG8R/2a2B15NcbW2nANtghfNTiG4l
 cgd6GSFvNSv7ruuLWcJliWUbSbrgTkGuis9fmraqeNk49lDN5WPhXwa3gjQ1Eic9/J9RD3d+snk
 qzWKf7610gVDOcxbnGHhHw28SD7T18w7vhzzP15cYjveDCbNuG1QespNebVn8dWhIMtjLlDTpfx
 hQgA9mdUE6JakQlj8FjhQdKq+xYH58XSNkYtt5ZYMLYb8LJW7jBKfXJSdyjrYNXHHjMfeLnMuj+
 607yYi4iSJYMLCbXnZdlAUkdJG3Hd6/dv8zzpSsXD25jHZkkCfitmD04gmw2BwORdQAaGFpRG/8
 BBXNMXmG3WFKA88NZjSTPFHXs6MpBjZs7rgY1
X-Google-Smtp-Source: AGHT+IE+MhCsMyFG5OUeV58zYmjP9JU8Oui67PrTbyglP2n+4yHVkqfv6fxMrMwkUoNVeM8OpBuKHw==
X-Received: by 2002:a05:6512:ac5:b0:545:6a2:e59 with SMTP id
 2adb3069b0e04-54e8ced8404mr368108e87.18.1745568356838; 
 Fri, 25 Apr 2025 01:05:56 -0700 (PDT)
Received: from tunnel335574-pt.tunnel.tserv24.sto1.ipv6.he.net
 (tunnel335574-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:11::2])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-54e7cb3b65csm509377e87.85.2025.04.25.01.05.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 25 Apr 2025 01:05:56 -0700 (PDT)
Date: Fri, 25 Apr 2025 11:05:53 +0300 (EEST)
From: =?ISO-8859-15?Q?Martin_Storsj=F6?= <martin@martin.st>
To: Zhao Zhili <quinkblack@foxmail.com>
In-Reply-To: <tencent_30F74F81D579272438EA96114D00A048CD07@qq.com>
Message-ID: <8beda1da-4ee4-d5e8-ee4f-64c914d9cb10@martin.st>
References: <tencent_FCCD17A003CDE7CFD35572A73038C6961A07@qq.com>
 <9505F77B-E07E-4C00-B1DC-CB8215CF3DBC@chinaffmpeg.org>
 <tencent_30F74F81D579272438EA96114D00A048CD07@qq.com>
MIME-Version: 1.0
Subject: Re: [FFmpeg-devel] [PATCH 2/3] avformat/hls: Show error info when
 read key file failed
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Steven Liu <lq@chinaffmpeg.org>,
 FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/8beda1da-4ee4-d5e8-ee4f-64c914d9cb10@martin.st/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

On Thu, 24 Apr 2025, Zhao Zhili wrote:

>> On Apr 24, 2025, at 10:24, Steven Liu <lq@chinaffmpeg.org> wrote:
>>
>>
>>> On Apr 23, 2025, at 20:59, Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org> wrote:
>> Hi Zhili,
>>>
>>> From: Zhao Zhili <zhilizhao@tencent.com>
>>>
>>> ---
>>> libavformat/hls.c | 12 +++++++-----
>>> 1 file changed, 7 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/libavformat/hls.c b/libavformat/hls.c
>>> index 6623c80309..45c1b283c9 100644
>>> --- a/libavformat/hls.c
>>> +++ b/libavformat/hls.c
>>> @@ -1353,16 +1353,18 @@ static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg,
>>>    if (seg->key_type == KEY_AES_128 || seg->key_type == KEY_SAMPLE_AES) {
>>>        if (strcmp(seg->key, pls->key_url)) {
>>>            AVIOContext *pb = NULL;
>>> -            if (open_url(pls->parent, &pb, seg->key, &c->avio_opts, NULL, NULL) == 0) {
>>> +
>>> +            ret = open_url(pls->parent, &pb, seg->key, &c->avio_opts, NULL, NULL);
>>> +            if (ret >= 0) {
>>>                ret = avio_read(pb, pls->key, sizeof(pls->key));
>>>                if (ret != sizeof(pls->key)) {
>>> -                    av_log(pls->parent, AV_LOG_ERROR, "Unable to read key file %s\n",
>>> -                           seg->key);
>>> +                    av_log(pls->parent, AV_LOG_ERROR, "Unable to read key file %s, %s\n",
>>> +                           seg->key, av_err2str(ret));
>>>                }
>>>                ff_format_io_close(pls->parent, &pb);
>>>            } else {
>>> -                av_log(pls->parent, AV_LOG_ERROR, "Unable to open key file %s\n",
>>> -                       seg->key);
>>> +                av_log(pls->parent, AV_LOG_ERROR, "Unable to open key file %s, %s\n",
>>> +                       seg->key, av_err2str(ret));
>>>            }
>> Why not jump to cleanup immediately after an output error?
>
> Because I don't know why not return error when the code is added in 84465f21 since 2011, and not
> changed since then. I'm worried return error might trigger unknown bugs.
>
> Cc Martin. Is there some reason not to error out in this case? Does that reason still hold now?

I really don't remember if there was any specific reason for not wanting 
to error out directly at that point - I wouldn't think so.

So feel free to add that if it makes sense; it's most likely an oversight.

// Martin

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".