[FFmpeg-cvslog] avformat/hlsenc: avformat/hlsenc: simplified code

Steven Liu git at videolan.org
Wed Aug 21 11:46:51 EEST 2019


ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Tue Aug 20 11:46:10 2019 +0800| [c66d468795f7bccb8dedce91dd34af08d7b695f8] | committer: Steven Liu

avformat/hlsenc: avformat/hlsenc: simplified code

simplified code for get dirname string in hls_delete_old_segments

Signed-off-by: Steven Liu <lq at chinaffmpeg.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c66d468795f7bccb8dedce91dd34af08d7b695f8
---

 libavformat/hlsenc.c | 7 +------
 1 file changed, 1 insertion(+), 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



More information about the ffmpeg-cvslog mailing list