• Bela Bodecs's avatar
    avformat/hlsenc: fix handling of delete_segments when %v is present · 9825f77a
    Bela Bodecs authored
    When var_stream_map option is used, %v must appear either in segment
    name template or in the directory path. This latter case currently is
    not handled and delete_segments flag of hls_flags is broken now. This
    patch fix this. The root cause of the bug was that HLSSegment struct
    only stores the final filename part, but not the final directory path.
    Most of the cases, final path info is unneded, It only necessary when
    you want to delete old segments (e.g in case of live streaming).
    Without variant streams it was unnecessary to store the final directory
    path, because all segment were stored into the same directory. But
    introducing %v in directory names either require to store the final
    directory path into HLSSegment or associate segments with their variant
    streams to be able deleting them later. I have choosen the second
    solution and introduced a variant index data member into the segment
    struct.
    Signed-off-by: 's avatarBela Bodecs <bodecsb@vivanet.hu>
    Signed-off-by: 's avatarSteven Liu <lq@onvideo.cn>
    9825f77a
hlsenc.c 101 KB