You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
Revert "fftools/textformat/avtextformat: Make close functions return void"
This reverts commit7684243fbe
anda888975a3c
.
This commit is contained in:
@ -3074,7 +3074,7 @@ int main(int argc, char **argv)
|
||||
AVTextWriterContext *wctx;
|
||||
char *buf;
|
||||
char *f_name = NULL, *f_args = NULL;
|
||||
int ret, i;
|
||||
int ret, input_ret, i;
|
||||
|
||||
init_dynload();
|
||||
|
||||
@ -3201,11 +3201,19 @@ int main(int argc, char **argv)
|
||||
show_error(tctx, ret);
|
||||
}
|
||||
|
||||
input_ret = ret;
|
||||
|
||||
avtext_print_section_footer(tctx);
|
||||
|
||||
avtextwriter_context_close(&wctx);
|
||||
ret = avtextwriter_context_close(&wctx);
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "Writing output failed (closing writer): %s\n", av_err2str(ret));
|
||||
|
||||
avtext_context_close(&tctx);
|
||||
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);
|
||||
}
|
||||
|
||||
end:
|
||||
|
@ -98,13 +98,14 @@ static void bprint_bytes(AVBPrint *bp, const uint8_t *ubuf, size_t ubuf_size)
|
||||
av_bprintf(bp, "%02X", ubuf[i]);
|
||||
}
|
||||
|
||||
void avtext_context_close(AVTextFormatContext **ptctx)
|
||||
int avtext_context_close(AVTextFormatContext **ptctx)
|
||||
{
|
||||
AVTextFormatContext *tctx = *ptctx;
|
||||
int i;
|
||||
int ret = 0;
|
||||
|
||||
if (!tctx)
|
||||
return;
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
av_hash_freep(&tctx->hash);
|
||||
|
||||
@ -121,6 +122,7 @@ void avtext_context_close(AVTextFormatContext **ptctx)
|
||||
av_freep(&tctx->priv);
|
||||
av_opt_free(tctx);
|
||||
av_freep(ptctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -615,12 +617,13 @@ static const AVClass textwriter_class = {
|
||||
};
|
||||
|
||||
|
||||
void avtextwriter_context_close(AVTextWriterContext **pwctx)
|
||||
int avtextwriter_context_close(AVTextWriterContext **pwctx)
|
||||
{
|
||||
AVTextWriterContext *wctx = *pwctx;
|
||||
int ret = 0;
|
||||
|
||||
if (!wctx)
|
||||
return;
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
if (wctx->writer) {
|
||||
if (wctx->writer->uninit)
|
||||
@ -630,6 +633,7 @@ void avtextwriter_context_close(AVTextWriterContext **pwctx)
|
||||
}
|
||||
av_freep(&wctx->priv);
|
||||
av_freep(pwctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -158,7 +158,7 @@ typedef struct AVTextFormatOptions {
|
||||
int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *formatter, AVTextWriterContext *writer_context, const char *args,
|
||||
const AVTextFormatSection *sections, int nb_sections, AVTextFormatOptions options, char *show_data_hash);
|
||||
|
||||
void avtext_context_close(AVTextFormatContext **tctx);
|
||||
int avtext_context_close(AVTextFormatContext **tctx);
|
||||
|
||||
|
||||
void avtext_print_section_header(AVTextFormatContext *tctx, const void *data, int section_id);
|
||||
|
@ -49,7 +49,7 @@ typedef struct AVTextWriterContext {
|
||||
|
||||
int avtextwriter_context_open(AVTextWriterContext **pwctx, const AVTextWriter *writer);
|
||||
|
||||
void avtextwriter_context_close(AVTextWriterContext **pwctx);
|
||||
int avtextwriter_context_close(AVTextWriterContext **pwctx);
|
||||
|
||||
int avtextwriter_create_stdout(AVTextWriterContext **pwctx);
|
||||
|
||||
|
Reference in New Issue
Block a user