mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
avformat/hlsenc: simplify code to pass s directly
Suggested-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
parent
fdda832603
commit
0e10f54585
@ -365,7 +365,6 @@ fail:
|
|||||||
static int replace_str_data_in_filename(char **s, const char *filename, char placeholder, const char *datastring)
|
static int replace_str_data_in_filename(char **s, const char *filename, char placeholder, const char *datastring)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
char *new_filename;
|
|
||||||
char c;
|
char c;
|
||||||
int addchar_count;
|
int addchar_count;
|
||||||
int found_count = 0;
|
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);
|
av_bprint_finalize(&buf, NULL);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
|
if ((ret = av_bprint_finalize(&buf, s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
*s = new_filename;
|
|
||||||
return found_count;
|
return found_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int replace_int_data_in_filename(char **s, const char *filename, char placeholder, int64_t number)
|
static int replace_int_data_in_filename(char **s, const char *filename, char placeholder, int64_t number)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
char *new_filename;
|
|
||||||
char c;
|
char c;
|
||||||
int nd, addchar_count;
|
int nd, addchar_count;
|
||||||
int found_count = 0;
|
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);
|
av_bprint_finalize(&buf, NULL);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
|
if ((ret = av_bprint_finalize(&buf, s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
*s = new_filename;
|
|
||||||
return found_count;
|
return found_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user