Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e45d5575
Commit
e45d5575
authored
Feb 27, 2018
by
Serhii Marchuk
Committed by
Karthick Jeyapal
Mar 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/dashenc: Use HTTP DELETE for HTTP base proto
parent
0dd1fff1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
dashenc.c
libavformat/dashenc.c
+25
-3
No files found.
libavformat/dashenc.c
View file @
e45d5575
...
...
@@ -1131,6 +1131,28 @@ static int update_stream_extradata(AVFormatContext *s, OutputStream *os,
return
0
;
}
static
void
dashenc_delete_file
(
AVFormatContext
*
s
,
char
*
filename
)
{
DASHContext
*
c
=
s
->
priv_data
;
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
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"failed to delete %s
\n
"
,
filename
);
}
av_dict_free
(
&
http_opts
);
dashenc_io_close
(
s
,
&
out
,
filename
);
}
else
if
(
unlink
(
filename
)
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"failed to delete %s: %s
\n
"
,
filename
,
strerror
(
errno
));
}
}
static
int
dash_flush
(
AVFormatContext
*
s
,
int
final
,
int
stream
)
{
DASHContext
*
c
=
s
->
priv_data
;
...
...
@@ -1215,7 +1237,7 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
for
(
j
=
0
;
j
<
remove
;
j
++
)
{
char
filename
[
1024
];
snprintf
(
filename
,
sizeof
(
filename
),
"%s%s"
,
c
->
dirname
,
os
->
segments
[
j
]
->
file
);
unlink
(
filename
);
dashenc_delete_file
(
s
,
filename
);
av_free
(
os
->
segments
[
j
]);
}
os
->
nb_segments
-=
remove
;
...
...
@@ -1367,9 +1389,9 @@ static int dash_write_trailer(AVFormatContext *s)
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
OutputStream
*
os
=
&
c
->
streams
[
i
];
snprintf
(
filename
,
sizeof
(
filename
),
"%s%s"
,
c
->
dirname
,
os
->
initfile
);
unlink
(
filename
);
dashenc_delete_file
(
s
,
filename
);
}
unlink
(
s
->
url
);
dashenc_delete_file
(
s
,
s
->
url
);
}
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment