aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dashenc.c
diff options
context:
space:
mode:
authorAndrey Semashev <andrey.semashev@gmail.com>2018-11-28 14:36:09 +0300
committerKarthick J <kjeyapal@akamai.com>2018-12-02 19:07:30 +0530
commit84c17449ce221c42475403a133e91c7677034c98 (patch)
treea0a91a9106bf6c6d0a0d8460a040006d8edbcfe7 /libavformat/dashenc.c
parent2a5cf8a241e3591015dfc94ecca66ffe5b08e29e (diff)
downloadffmpeg-84c17449ce221c42475403a133e91c7677034c98.tar.gz
lavf/dashenc: Delete HLS manifests on trailer writing if remove_at_exit is set.
This fixes HLS manifests being left behind if remove_at_exit is set.
Diffstat (limited to 'libavformat/dashenc.c')
-rw-r--r--libavformat/dashenc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index a7d8c4e237..af3f0ee167 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1619,6 +1619,18 @@ static int dash_write_trailer(AVFormatContext *s)
dashenc_delete_file(s, filename);
}
dashenc_delete_file(s, s->url);
+
+ if (c->hls_playlist && c->master_playlist_created) {
+ for (i = 0; i < s->nb_streams; i++) {
+ OutputStream *os = &c->streams[i];
+ if (os->segment_type == SEGMENT_TYPE_MP4) {
+ get_hls_playlist_name(filename, sizeof(filename), c->dirname, i);
+ dashenc_delete_file(s, filename);
+ }
+ }
+ snprintf(filename, sizeof(filename), "%smaster.m3u8", c->dirname);
+ dashenc_delete_file(s, filename);
+ }
}
return 0;