Skip to content

Commit 956ccf4

Browse files
authored
Fix typo in params field (#409)
1 parent 144a983 commit 956ccf4

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

ffmpeg/decoder.c

+10-11
Original file line numberDiff line numberDiff line change
@@ -335,24 +335,23 @@ int open_input(input_params *params, struct input_ctx *ctx)
335335
char *inp = params->fname;
336336
int ret = 0;
337337

338-
ctx->transmuxing = params->transmuxe;
338+
ctx->transmuxing = params->transmuxing;
339339

340340
// open demuxer
341341
ret = avformat_open_input(&ic, inp, NULL, NULL);
342342
if (ret < 0) LPMS_ERR(open_input_err, "demuxer: Unable to open input");
343343
ctx->ic = ic;
344344
ret = avformat_find_stream_info(ic, NULL);
345345
if (ret < 0) LPMS_ERR(open_input_err, "Unable to find input info");
346-
if (params->transmuxe == 0) {
347-
ret = open_video_decoder(params, ctx);
348-
if (ret < 0) LPMS_ERR(open_input_err, "Unable to open video decoder")
349-
ret = open_audio_decoder(params, ctx);
350-
if (ret < 0) LPMS_ERR(open_input_err, "Unable to open audio decoder")
351-
ctx->last_frame_v = av_frame_alloc();
352-
if (!ctx->last_frame_v) LPMS_ERR(open_input_err, "Unable to alloc last_frame_v");
353-
ctx->last_frame_a = av_frame_alloc();
354-
if (!ctx->last_frame_a) LPMS_ERR(open_input_err, "Unable to alloc last_frame_a");
355-
}
346+
if (params->transmuxing) return 0;
347+
ret = open_video_decoder(params, ctx);
348+
if (ret < 0) LPMS_ERR(open_input_err, "Unable to open video decoder")
349+
ret = open_audio_decoder(params, ctx);
350+
if (ret < 0) LPMS_ERR(open_input_err, "Unable to open audio decoder")
351+
ctx->last_frame_v = av_frame_alloc();
352+
if (!ctx->last_frame_v) LPMS_ERR(open_input_err, "Unable to alloc last_frame_v");
353+
ctx->last_frame_a = av_frame_alloc();
354+
if (!ctx->last_frame_a) LPMS_ERR(open_input_err, "Unable to alloc last_frame_a");
356355

357356
return 0;
358357

ffmpeg/ffmpeg.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ func (t *Transcoder) Transcode(input *TranscodeOptionsIn, ps []TranscodeOptions)
945945
inp := &C.input_params{fname: fname, hw_type: hw_type, device: device, xcoderParams: xcoderParams,
946946
handle: t.handle}
947947
if input.Transmuxing {
948-
inp.transmuxe = 1
948+
inp.transmuxing = 1
949949
}
950950
results := make([]C.output_results, len(ps))
951951
decoded := &C.output_results{}

ffmpeg/transcoder.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ typedef struct {
5454
// Optional video decoder + opts
5555
component_opts video;
5656

57-
int transmuxe;
57+
// concatenates multiple inputs into the same output
58+
int transmuxing;
5859
} input_params;
5960

6061
#define MAX_CLASSIFY_SIZE 10

0 commit comments

Comments
 (0)