Skip to content

Commit

Permalink
Fix typo in params field (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
j0sh authored Jul 25, 2024
1 parent 144a983 commit 956ccf4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
21 changes: 10 additions & 11 deletions ffmpeg/decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,24 +335,23 @@ 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);
if (ret < 0) LPMS_ERR(open_input_err, "demuxer: Unable to open input");
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;

Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
3 changes: 2 additions & 1 deletion ffmpeg/transcoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 956ccf4

Please sign in to comment.