X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=doc%2Fexamples%2Ftranscode_aac.c;h=b19349573ac59d07553ba7ead018b5c64b711e1f;hb=d28eb0e34d80f12b779c7b6befc5b350ffcdf476;hp=9fd5c00d6059ef67e3f10c5b6fcc8f921a209340;hpb=82fc222f676fd4e0dc8328e3abf17fba45d11af5;p=ffmpeg diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 9fd5c00d605..b19349573ac 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -171,8 +171,11 @@ static int open_output_file(const char *filename, goto cleanup; } - av_strlcpy((*output_format_context)->filename, filename, - sizeof((*output_format_context)->filename)); + if (!((*output_format_context)->url = av_strdup(filename))) { + fprintf(stderr, "Could not allocate url.\n"); + error = AVERROR(ENOMEM); + goto cleanup; + } /* Find the encoder to be used by its name. */ if (!(output_codec = avcodec_find_encoder(AV_CODEC_ID_AAC))) { @@ -750,8 +753,6 @@ int main(int argc, char **argv) exit(1); } - /* Register all codecs and formats so that they can be used. */ - av_register_all(); /* Open the input file for reading. */ if (open_input_file(argv[1], &input_format_context, &input_codec_context))