From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 0F436411D3 for ; Sun, 7 Jul 2024 08:58:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7A5B868DA69; Sun, 7 Jul 2024 11:58:42 +0300 (EEST) Received: from mail.chinaffmpeg.org (unknown [101.33.120.246]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1BF0D68D9C6 for ; Sun, 7 Jul 2024 11:58:36 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=chinaffmpeg.org; s=mail; t=1720342161; bh=0KfLeTRXy7r1yVSTmyGYkaBP/T2LMwiau6mbCw9b2KE=; h=From:To:Cc:Subject; b=imSDua7ac1F7G00TspjRKkKvgHbE5eY+KTDXxFUb23Tbra83Yrjh2abSHLoIkGG4n k5rNWG+6f92RDb4ujnDgd+fJgxUwNAwkwnFvChR3VbtWcYnDRvcenhfVVkGGWQoFNj ao+z0d2qCKxYp/eNY8rctU/JVDakiz6PNLVHHDHuZYI7+9PU1cCz6GfuEl/fBPOonT TnoTA0VIfK9UwHeUiEhHnW3klIntAf2aNos8dgAn4hTzui6F+AgZBShQBlKovwrgY6 2YPKDdaJsiT1nH036xX9G29GX3MKvtycDEdJPDTsl/gUCX0q9yw49O9LosEmxyswbZ ObzhRObBLMMBw== From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 Jul 2024 16:49:20 +0800 Message-Id: <20240707084920.7880-1-lq@chinaffmpeg.org> Subject: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine error message when retry with new http session X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Steven Liu MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fix CID: 1609624 The hlsenc should give error message when hlsenc_io_open error, release memory of filename and options, should return warning message when hlsenc_io_close error. Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 274de00f9a..494875bc3c 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2617,8 +2617,17 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) " will retry with a new http session.\n"); ff_format_io_close(s, &vs->out); ret = hlsenc_io_open(s, &vs->out, filename, &options); + if (ret < 0) { + av_log(s, hls->ignore_io_errors ? AV_LOG_WARNING : AV_LOG_ERROR, + "Failed to open file '%s'\n", filename); + av_freep(&filename); + av_dict_free(&options); + return hls->ignore_io_errors ? 0 : ret; + } reflush_dynbuf(vs, &range_length); ret = hlsenc_io_close(s, &vs->out, filename); + if (ret < 0) + av_log(s, AV_LOG_WARNING, "Failed retry upload file '%s' with new http session.\n", oc->url); } av_dict_free(&options); av_freep(&vs->temp_buffer); -- 2.43.0 _______________________________________________ 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".