[FFmpeg-devel] [PATCH v3 6/6] avformat/hlsenc: simplify code to pass s directly
lance.lmwang at gmail.com
lance.lmwang at gmail.com
Fri Jun 26 17:01:49 EEST 2020
On Thu, Jun 25, 2020 at 07:32:39AM +0800, lance.lmwang at gmail.com wrote:
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Suggested-by: Nicolas George <george at nsup.org>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
> libavformat/hlsenc.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index a34da2f..0a318d2 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -365,7 +365,6 @@ fail:
> static int replace_str_data_in_filename(char **s, const char *filename, char placeholder, const char *datastring)
> {
> const char *p;
> - char *new_filename;
> char c;
> int addchar_count;
> int found_count = 0;
> @@ -398,16 +397,14 @@ static int replace_str_data_in_filename(char **s, const char *filename, char pla
> av_bprint_finalize(&buf, NULL);
> return AVERROR(ENOMEM);
> }
> - if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
> + if ((ret = av_bprint_finalize(&buf, s)) < 0)
> return ret;
> - *s = new_filename;
> return found_count;
> }
>
> static int replace_int_data_in_filename(char **s, const char *filename, char placeholder, int64_t number)
> {
> const char *p;
> - char *new_filename;
> char c;
> int nd, addchar_count;
> int found_count = 0;
> @@ -448,9 +445,8 @@ static int replace_int_data_in_filename(char **s, const char *filename, char pla
> av_bprint_finalize(&buf, NULL);
> return AVERROR(ENOMEM);
> }
> - if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
> + if ((ret = av_bprint_finalize(&buf, s)) < 0)
> return ret;
> - *s = new_filename;
> return found_count;
> }
>
> --
> 1.8.3.1
>
will apply the patchset tomorrow if no objections.
--
Thanks,
Limin Wang
More information about the ffmpeg-devel
mailing list