From: Basel Sayeh <basel.sayeh@hotmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Basel Sayeh <basel.sayeh@hotmail.com>
Subject: [FFmpeg-devel] [PATCH v4 2/2] libavformat/dashenc: Enable HTTP persistent connections for for dashenc_delete_file
Date: Tue, 6 Dec 2022 17:12:16 +0300
Message-ID: <DB9P191MB14827ED8E728FBAE1D641FB1FE1B9@DB9P191MB1482.EURP191.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <DB9P191MB148247A509BEF5A63C96F4F6FE1B9@DB9P191MB1482.EURP191.PROD.OUTLOOK.COM>
Signed-off-by: Basel Sayeh <basel.sayeh@hotmail.com>
---
libavformat/dashenc.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 9c1bcad9e3..ba0eb913a1 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -179,6 +179,7 @@ typedef struct DASHContext {
int master_playlist_created;
AVIOContext *mpd_out;
AVIOContext *m3u8_out;
+ AVIOContext *http_delete;
int streaming;
int64_t timeout;
int index_correction;
@@ -642,6 +643,7 @@ static void dash_free(AVFormatContext *s)
ff_format_io_close(s, &c->mpd_out);
ff_format_io_close(s, &c->m3u8_out);
+ ff_format_io_close(s, &c->http_delete);
}
static void output_segment_list(OutputStream *os, AVIOContext *out, AVFormatContext *s,
@@ -1855,18 +1857,22 @@ static void dashenc_delete_file(AVFormatContext *s, char *filename) {
int http_base_proto = ff_is_http_proto(filename);
if (http_base_proto) {
- AVIOContext *out = NULL;
AVDictionary *http_opts = NULL;
set_http_options(&http_opts, c);
av_dict_set(&http_opts, "method", "DELETE", 0);
- if (dashenc_io_open(s, &out, filename, &http_opts) < 0) {
+ if (dashenc_io_open(s, &c->http_delete, filename, &http_opts) < 0) {
av_log(s, AV_LOG_ERROR, "failed to delete %s\n", filename);
+ } else {
+ //Nothing to write
+ avio_flush(c->http_delete);
+ dashenc_io_close(s, &c->http_delete, filename);
}
-
av_dict_free(&http_opts);
- ff_format_io_close(s, &out);
+
+ if (!c->http_persistent)
+ ff_format_io_close(s, &c->http_delete);
} else {
int res = ffurl_delete(filename);
if (res < 0) {
--
2.30.2
_______________________________________________
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".
next prev parent reply other threads:[~2022-12-06 14:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 14:09 [FFmpeg-devel] [PATCH v4 1/2] libavformat/hlsenc: Enable HTTP persistent connections for for hls_delete_file Basel Sayeh
2022-12-06 14:12 ` Basel Sayeh [this message]
2022-12-06 14:34 ` Basel Sayeh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB9P191MB14827ED8E728FBAE1D641FB1FE1B9@DB9P191MB1482.EURP191.PROD.OUTLOOK.COM \
--to=basel.sayeh@hotmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git