mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
hlsenc: Don't reset the number variable when wrapping
The counter itself shouldn't be wrapped, since it is used for determining end_pts for the next segment - only wrap the number used for the segment file name. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
09c93b1b95
commit
9d86bfc259
1 changed files with 2 additions and 4 deletions
|
|
@ -164,12 +164,10 @@ static int hls_start(AVFormatContext *s)
|
|||
AVFormatContext *oc = c->avf;
|
||||
int err = 0;
|
||||
|
||||
if (c->wrap)
|
||||
c->number %= c->wrap;
|
||||
|
||||
if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
|
||||
c->basename, c->number++) < 0)
|
||||
c->basename, c->wrap ? c->number % c->wrap : c->number) < 0)
|
||||
return AVERROR(EINVAL);
|
||||
c->number++;
|
||||
|
||||
if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
|
||||
&s->interrupt_callback, NULL)) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue