[FFmpeg-devel] [PATCH]Fix hls wrapping

Stefano Sabatini stefasab at gmail.com
Wed Jun 5 19:24:19 CEST 2013


On date Wednesday 2013-06-05 11:57:54 +0200, Carl Eugen Hoyos encoded:
> Hi!
> 
> Attached patch fixes ticket #2643 for me.
> 
> Please comment, Carl Eugen

> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index e97b4e0..af04d09 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -164,14 +164,12 @@ 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) {
>          av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n", c->basename);
>          return AVERROR(EINVAL);
>      }
> +    c->number++;

LGTM with a meaningful commit message (which is part of the commit and
thus should be reviewed as well).
-- 
FFmpeg = Foolish and Faithless Mastodontic Proud Elastic Game


More information about the ffmpeg-devel mailing list