+ input_codec_ctx = avcodec_alloc_context3(input_codec);
+ if (input_codec_ctx == NULL) {
+ fprintf(stderr, "failed to allocate the input codec context\n");
+ ret = -ENOMEM;
+ goto cleanup;
+ }
+
+ ret = avcodec_parameters_to_context(input_codec_ctx, input_codec_params);
+ if (ret < 0) {
+ fprintf(stderr, "cannot copy parameters to input codec context\n");
+ goto cleanup_ctx;
+ }
+