mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-19 21:06:42 +00:00
hlsenc: Fix setting vs->start_pos when not using HLS_SINGLE_FILE or hls_segment_size
When not using HLS_SINGLE_FILE or hls_segment_size, we're writing each segment into a separate file. In that case, the file start pos for each segment will be zero. This matches the case in (hls->max_seg_size > 0) above, where we decide to switch to a new file. This fixes the calculation of "vs->size = new_start_pos - vs->start_pos" at the start of hls_write_packet; previously, start_pos would refer to the byte size of the previous segment file, giving vs->size entirely bogus values here. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
01312fdfcf
commit
52f57568d5
@ -2659,7 +2659,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
vs->start_pos = new_start_pos;
|
vs->start_pos = new_start_pos;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vs->start_pos = new_start_pos;
|
vs->start_pos = 0;
|
||||||
sls_flag_file_rename(hls, vs, old_filename);
|
sls_flag_file_rename(hls, vs, old_filename);
|
||||||
ret = hls_start(s, vs);
|
ret = hls_start(s, vs);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user