From d174fffcd1151856c8ef77838ddc7d64a896866e Mon Sep 17 00:00:00 2001 From: Josh Allmann Date: Mon, 22 Jul 2024 19:52:58 +0000 Subject: [PATCH] Fix typo in params field --- ffmpeg/decoder.c | 21 ++++++++++----------- ffmpeg/ffmpeg.go | 2 +- ffmpeg/transcoder.h | 3 ++- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ffmpeg/decoder.c b/ffmpeg/decoder.c index 67123c5f92..8fd0fa3dd3 100755 --- a/ffmpeg/decoder.c +++ b/ffmpeg/decoder.c @@ -335,7 +335,7 @@ int open_input(input_params *params, struct input_ctx *ctx) char *inp = params->fname; int ret = 0; - ctx->transmuxing = params->transmuxe; + ctx->transmuxing = params->transmuxing; // open demuxer ret = avformat_open_input(&ic, inp, NULL, NULL); @@ -343,16 +343,15 @@ int open_input(input_params *params, struct input_ctx *ctx) ctx->ic = ic; ret = avformat_find_stream_info(ic, NULL); if (ret < 0) LPMS_ERR(open_input_err, "Unable to find input info"); - if (params->transmuxe == 0) { - ret = open_video_decoder(params, ctx); - if (ret < 0) LPMS_ERR(open_input_err, "Unable to open video decoder") - ret = open_audio_decoder(params, ctx); - if (ret < 0) LPMS_ERR(open_input_err, "Unable to open audio decoder") - ctx->last_frame_v = av_frame_alloc(); - if (!ctx->last_frame_v) LPMS_ERR(open_input_err, "Unable to alloc last_frame_v"); - ctx->last_frame_a = av_frame_alloc(); - if (!ctx->last_frame_a) LPMS_ERR(open_input_err, "Unable to alloc last_frame_a"); - } + if (params->transmuxing) return 0; + ret = open_video_decoder(params, ctx); + if (ret < 0) LPMS_ERR(open_input_err, "Unable to open video decoder") + ret = open_audio_decoder(params, ctx); + if (ret < 0) LPMS_ERR(open_input_err, "Unable to open audio decoder") + ctx->last_frame_v = av_frame_alloc(); + if (!ctx->last_frame_v) LPMS_ERR(open_input_err, "Unable to alloc last_frame_v"); + ctx->last_frame_a = av_frame_alloc(); + if (!ctx->last_frame_a) LPMS_ERR(open_input_err, "Unable to alloc last_frame_a"); return 0; diff --git a/ffmpeg/ffmpeg.go b/ffmpeg/ffmpeg.go index 6ed3442dd9..1240c28f04 100755 --- a/ffmpeg/ffmpeg.go +++ b/ffmpeg/ffmpeg.go @@ -945,7 +945,7 @@ func (t *Transcoder) Transcode(input *TranscodeOptionsIn, ps []TranscodeOptions) inp := &C.input_params{fname: fname, hw_type: hw_type, device: device, xcoderParams: xcoderParams, handle: t.handle} if input.Transmuxing { - inp.transmuxe = 1 + inp.transmuxing = 1 } results := make([]C.output_results, len(ps)) decoded := &C.output_results{} diff --git a/ffmpeg/transcoder.h b/ffmpeg/transcoder.h index 53ded33f35..c9662063e7 100755 --- a/ffmpeg/transcoder.h +++ b/ffmpeg/transcoder.h @@ -54,7 +54,8 @@ typedef struct { // Optional video decoder + opts component_opts video; - int transmuxe; + // concatenates multiple inputs into the same output + int transmuxing; } input_params; #define MAX_CLASSIFY_SIZE 10