提交 db92efd8 编写于 作者: L Limin Wang

avformat/hlsenc: use proper error codes

Signed-off-by: NLimin Wang <lance.lmwang@gmail.com>
上级 64059f50
...@@ -370,6 +370,7 @@ static int replace_str_data_in_filename(char **s, const char *filename, char pla ...@@ -370,6 +370,7 @@ static int replace_str_data_in_filename(char **s, const char *filename, char pla
int addchar_count; int addchar_count;
int found_count = 0; int found_count = 0;
AVBPrint buf; AVBPrint buf;
int ret;
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
...@@ -395,10 +396,10 @@ static int replace_str_data_in_filename(char **s, const char *filename, char pla ...@@ -395,10 +396,10 @@ static int replace_str_data_in_filename(char **s, const char *filename, char pla
} }
if (!av_bprint_is_complete(&buf)) { if (!av_bprint_is_complete(&buf)) {
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
return -1; return AVERROR(ENOMEM);
} }
if (av_bprint_finalize(&buf, &new_filename) < 0 || !new_filename) if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
return -1; return ret;
*s = new_filename; *s = new_filename;
return found_count; return found_count;
} }
...@@ -411,6 +412,7 @@ static int replace_int_data_in_filename(char **s, const char *filename, char pla ...@@ -411,6 +412,7 @@ static int replace_int_data_in_filename(char **s, const char *filename, char pla
int nd, addchar_count; int nd, addchar_count;
int found_count = 0; int found_count = 0;
AVBPrint buf; AVBPrint buf;
int ret;
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
...@@ -444,10 +446,10 @@ static int replace_int_data_in_filename(char **s, const char *filename, char pla ...@@ -444,10 +446,10 @@ static int replace_int_data_in_filename(char **s, const char *filename, char pla
} }
if (!av_bprint_is_complete(&buf)) { if (!av_bprint_is_complete(&buf)) {
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
return -1; return AVERROR(ENOMEM);
} }
if (av_bprint_finalize(&buf, &new_filename) < 0 || !new_filename) if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
return -1; return ret;
*s = new_filename; *s = new_filename;
return found_count; return found_count;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册