Browse Source

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>
tags/n4.3
Steven Liu 6 years ago
parent
commit
c66d468795
1 changed files with 1 additions and 6 deletions
  1. +1
    -6
      libavformat/hlsenc.c

+ 1
- 6
libavformat/hlsenc.c View File

@@ -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


Loading…
Cancel
Save