mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-27 17:08:32 +00:00
[fd/hls] Fix format_index=0
parsing with --hls-split-discontinuity
When treating each discontinuity as a separate format, this code should
only consider items within the requested discontinuity. But when the
requested discontinuity has index 0, it currently considers everything
because 0 is not truthy.
Fix the issue by explicitly checking for non-`None` `format_index`,
which indicates that `--hls-split-discontinuity` was passed.
Fixes: 310c2ed2c6
("Better support HLS media discontinuity and fully support media initialization (#105)")
This commit is contained in:
parent
2685654a37
commit
9373402408
@ -198,7 +198,7 @@ def is_ad_fragment_end(s):
|
||||
line = line.strip()
|
||||
if line:
|
||||
if not line.startswith('#'):
|
||||
if format_index and discontinuity_count != format_index:
|
||||
if format_index is not None and discontinuity_count != format_index:
|
||||
continue
|
||||
if ad_frag_next:
|
||||
continue
|
||||
@ -224,7 +224,7 @@ def is_ad_fragment_end(s):
|
||||
byte_range = {}
|
||||
|
||||
elif line.startswith('#EXT-X-MAP'):
|
||||
if format_index and discontinuity_count != format_index:
|
||||
if format_index is not None and discontinuity_count != format_index:
|
||||
continue
|
||||
if frag_index > 0:
|
||||
self.report_error(
|
||||
|
Loading…
Reference in New Issue
Block a user