mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-17 23:17:41 +08:00
fftools/textformat/avtextformat: Make close functions return void
Just like normal close functions. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -3077,7 +3077,7 @@ int main(int argc, char **argv)
|
||||
AVTextWriterContext *wctx;
|
||||
char *buf;
|
||||
char *f_name = NULL, *f_args = NULL;
|
||||
int ret, input_ret, i;
|
||||
int ret, i;
|
||||
|
||||
init_dynload();
|
||||
|
||||
@ -3197,19 +3197,11 @@ int main(int argc, char **argv)
|
||||
show_error(tctx, ret);
|
||||
}
|
||||
|
||||
input_ret = ret;
|
||||
|
||||
avtext_print_section_footer(tctx);
|
||||
|
||||
ret = avtextwriter_context_close(&wctx);
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "Writing output failed (closing writer): %s\n", av_err2str(ret));
|
||||
avtextwriter_context_close(&wctx);
|
||||
|
||||
ret = avtext_context_close(&tctx);
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "Writing output failed (closing formatter): %s\n", av_err2str(ret));
|
||||
|
||||
ret = FFMIN(ret, input_ret);
|
||||
avtext_context_close(&tctx);
|
||||
}
|
||||
|
||||
end:
|
||||
|
@ -99,14 +99,13 @@ static void bprint_bytes(AVBPrint *bp, const uint8_t *ubuf, size_t ubuf_size)
|
||||
av_bprintf(bp, "%02X", ubuf[i]);
|
||||
}
|
||||
|
||||
int avtext_context_close(AVTextFormatContext **ptctx)
|
||||
void avtext_context_close(AVTextFormatContext **ptctx)
|
||||
{
|
||||
AVTextFormatContext *tctx = *ptctx;
|
||||
int i;
|
||||
int ret = 0;
|
||||
|
||||
if (!tctx)
|
||||
return AVERROR(EINVAL);
|
||||
return;
|
||||
|
||||
av_hash_freep(&tctx->hash);
|
||||
|
||||
@ -123,7 +122,6 @@ int avtext_context_close(AVTextFormatContext **ptctx)
|
||||
av_freep(&tctx->priv);
|
||||
av_opt_free(tctx);
|
||||
av_freep(ptctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -584,13 +582,13 @@ static const AVClass textwriter_class = {
|
||||
};
|
||||
|
||||
|
||||
int avtextwriter_context_close(AVTextWriterContext **pwctx)
|
||||
void avtextwriter_context_close(AVTextWriterContext **pwctx)
|
||||
{
|
||||
AVTextWriterContext *wctx = *pwctx;
|
||||
int ret = 0;
|
||||
|
||||
if (!wctx)
|
||||
return AVERROR(EINVAL);
|
||||
return;
|
||||
|
||||
if (wctx->writer) {
|
||||
if (wctx->writer->uninit)
|
||||
@ -600,7 +598,6 @@ int avtextwriter_context_close(AVTextWriterContext **pwctx)
|
||||
}
|
||||
av_freep(&wctx->priv);
|
||||
av_freep(pwctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,7 +132,7 @@ int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form
|
||||
int show_optional_fields,
|
||||
char *show_data_hash);
|
||||
|
||||
int avtext_context_close(AVTextFormatContext **tctx);
|
||||
void avtext_context_close(AVTextFormatContext **tctx);
|
||||
|
||||
|
||||
void avtext_print_section_header(AVTextFormatContext *tctx, const void *data, int section_id);
|
||||
|
@ -55,7 +55,7 @@ typedef struct AVTextWriterContext {
|
||||
|
||||
int avtextwriter_context_open(AVTextWriterContext **pwctx, const AVTextWriter *writer);
|
||||
|
||||
int avtextwriter_context_close(AVTextWriterContext **pwctx);
|
||||
void avtextwriter_context_close(AVTextWriterContext **pwctx);
|
||||
|
||||
int avtextwriter_create_stdout(AVTextWriterContext **pwctx);
|
||||
|
||||
|
Reference in New Issue
Block a user