• Steven Liu's avatar
    avformat/hlsenc: support multi level path in m3u8 with filename · be1d3249
    Steven Liu authored
    before patch:
    
    localhost:osx liuqi$ tree 20160926/
    20160926/
    └── file-20160909
        └── 26
            └── 16
                └── 15
                    ├── 46
                    │   ├── 13.ts
                    │   ├── 25.ts
                    │   ├── 36.ts
                    │   ├── 45.ts
                    │   └── 54.ts
                    └── 47
                        ├── 04.ts
                        ├── 14.ts
                        ├── 24.ts
                        └── 35.ts
    
    6 directories, 9 files
    localhost:osx liuqi$ cat out.m3u8
     #EXTM3U
     #EXT-X-VERSION:3
     #EXT-X-TARGETDURATION:12
     #EXT-X-MEDIA-SEQUENCE:0
     #EXTINF:11.360000,
     13.ts
     #EXTINF:10.800000,
     25.ts
     #EXTINF:9.120000,
     36.ts
     #EXTINF:8.760000,
     45.ts
     #EXTINF:10.200000,
     54.ts
     #EXTINF:10.720000,
     04.ts
     #EXTINF:9.600000,
     14.ts
     #EXTINF:10.600000,
     24.ts
     #EXTINF:8.760000,
     35.ts
     #EXT-X-ENDLIST
    
    after patch:
    
    localhost:osx liuqi$ tree 20160926/
    20160926/
    └── file-20160909
        └── 26
            └── 16
                └── 15
                    ├── 46
                    │   ├── 13.ts
                    │   ├── 25.ts
                    │   ├── 36.ts
                    │   ├── 45.ts
                    │   └── 54.ts
                    └── 47
                        ├── 04.ts
                        ├── 14.ts
                        ├── 24.ts
                        └── 35.ts
    
    6 directories, 9 files
    localhost:osx liuqi$ cat out.m3u8
     #EXTM3U
     #EXT-X-VERSION:3
     #EXT-X-TARGETDURATION:12
     #EXT-X-MEDIA-SEQUENCE:0
     #EXTINF:11.360000,
     20160926/file-20160909/26/16/15/46/13.ts
     #EXTINF:10.800000,
     20160926/file-20160909/26/16/15/46/25.ts
     #EXTINF:9.120000,
     20160926/file-20160909/26/16/15/46/36.ts
     #EXTINF:8.760000,
     20160926/file-20160909/26/16/15/46/45.ts
     #EXTINF:10.200000,
     20160926/file-20160909/26/16/15/46/54.ts
     #EXTINF:10.720000,
     20160926/file-20160909/26/16/15/47/04.ts
     #EXTINF:9.600000,
     20160926/file-20160909/26/16/15/47/14.ts
     #EXTINF:10.600000,
     20160926/file-20160909/26/16/15/47/24.ts
     #EXTINF:8.760000,
     20160926/file-20160909/26/16/15/47/35.ts
     #EXT-X-ENDLIST
    Signed-off-by: 's avatarSteven Liu <lingjiujianke@gmail.com>
    be1d3249
hlsenc.c 39.2 KB