diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2019-08-20 11:46:10 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2019-08-21 16:46:35 +0800 |
commit | c66d468795f7bccb8dedce91dd34af08d7b695f8 (patch) | |
tree | 76641902075f36105664e91a2e0c3f84d735b907 | |
parent | fa78a6abb379f9e8193bd02821aba006bd092ed4 (diff) | |
download | ffmpeg-c66d468795f7bccb8dedce91dd34af08d7b695f8.tar.gz |
avformat/hlsenc: avformat/hlsenc: simplified code
simplified code for get dirname string in hls_delete_old_segments
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
-rw-r--r-- | libavformat/hlsenc.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 9511b65e2d..18173cdce1 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -505,18 +505,13 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls, } if (segment && !hls->use_localtime_mkdir) { - if (hls->segment_filename) { - dirname = av_strdup(hls->segment_filename); - } else { - dirname = av_strdup(vs->avf->url); - } + dirname = hls->segment_filename ? av_strdup(hls->segment_filename): av_strdup(vs->avf->url); if (!dirname) { ret = AVERROR(ENOMEM); goto fail; } p = (char *)av_basename(dirname); *p = '\0'; - } /* if %v is present in the file's directory |