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>
This commit is contained in:
parent
fa78a6abb3
commit
c66d468795
@ -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…
x
Reference in New Issue
Block a user