[FFmpeg-devel] ffmpeg_opt.c wrong parameter for Filter

sebastian-doerfler at t-online.de sebastian-doerfler at t-online.de
Thu Mar 29 15:53:17 EEST 2018


 
 
use the ost->enc_ctx->channel_layout for f->channel_layout
 
not 
 
f->channel_layout = av_get_default_channel_layout(ost->enc_ctx->channels);
 
 
ffmpeg_opt.c
 
static int open_output_file(OptionsContext *o, const char *filename)
 
Old:
 
if (ost->enc_ctx->channels) {
f->channel_layout = av_get_default_channel_layout(ost->enc_ctx->channels);
} else if (ost->enc->channel_layouts) {
count = 0;
while (ost->enc->channel_layouts[count])
count++;
f->channel_layouts = av_mallocz_array(count + 1, 
sizeof(*f->channel_layouts));
if (!f->channel_layouts)
exit_program(1);
memcpy(f->channel_layouts, ost->enc->channel_layouts,
(count + 1) * sizeof(*f->channel_layouts));
}
 
 
new:
 
if (ost->enc_ctx->channel_layout) {
f->channel_layout = ost->enc_ctx->channel_layout;
}
else if (ost->enc_ctx->channels) {
f->channel_layout = av_get_default_channel_layout(ost->enc_ctx->channels);
}
else if (ost->enc->channel_layouts) {
count = 0;
while (ost->enc->channel_layouts[count])
count++;
f->channel_layouts = av_mallocz_array(count + 1, 
sizeof(*f->channel_layouts));
if (!f->channel_layouts)
exit_program(1);
memcpy(f->channel_layouts, ost->enc->channel_layouts,
(count + 1) * sizeof(*f->channel_layouts));
}



More information about the ffmpeg-devel mailing list