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 F38D24743E for ; Sat, 6 Apr 2024 09:14:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B93A668D07E; Sat, 6 Apr 2024 12:14:53 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 10D6568CC2B for ; Sat, 6 Apr 2024 12:14:47 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id D0775EA3C8 for ; Sat, 6 Apr 2024 11:14:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oNy5NhJjd0Tu for ; Sat, 6 Apr 2024 11:14:44 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 6B017E99D8 for ; Sat, 6 Apr 2024 11:14:44 +0200 (CEST) Date: Sat, 6 Apr 2024 11:14:44 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20240331203505.12760-1-cus@passwd.hu> Message-ID: References: <20240331203505.12760-1-cus@passwd.hu> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: use a slash separator even in win32 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 31 Mar 2024, Marton Balint wrote: > We don't know if the protocol used is referring to a local file or a remote > resource, so it is better to simply use slash as separator which works all the > time. (well, except in very special cases when the user specified a \\?\ path) > > Fixes ticket #9780. Will apply soon. Regards, Marton > > Signed-off-by: Marton Balint > --- > libavformat/hlsenc.c | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c > index ac8bb189f0..bde7230036 100644 > --- a/libavformat/hlsenc.c > +++ b/libavformat/hlsenc.c > @@ -570,12 +570,6 @@ static void reflush_dynbuf(VariantStream *vs, int *range_length) > avio_write(vs->out, vs->temp_buffer, *range_length); > } > > -#if HAVE_DOS_PATHS > -#define SEPARATOR '\\' > -#else > -#define SEPARATOR '/' > -#endif > - > static int hls_delete_file(HLSContext *hls, AVFormatContext *avf, > char *path, const char *proto) > { > @@ -668,7 +662,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls, > av_log(hls, AV_LOG_DEBUG, "deleting old segment %s\n", > segment->filename); > if (!hls->use_localtime_mkdir) // segment->filename contains basename only > - av_bprintf(&path, "%s%c", dirname, SEPARATOR); > + av_bprintf(&path, "%s/", dirname); > av_bprintf(&path, "%s", segment->filename); > > if (!av_bprint_is_complete(&path)) { > @@ -685,8 +679,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls, > vtt_dirname = av_dirname(vtt_dirname_r); > > av_bprint_clear(&path); > - av_bprintf(&path, "%s%c%s", vtt_dirname, SEPARATOR, > - segment->sub_filename); > + av_bprintf(&path, "%s/%s", vtt_dirname, segment->sub_filename); > av_freep(&vtt_dirname_r); > > if (!av_bprint_is_complete(&path)) { > -- > 2.35.3 > > _______________________________________________ > 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". > _______________________________________________ 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".