[Libav-user] transcoding_acc.c FFmpeg API example

Mohamed Moanis mohamed_moanis at outlook.com
Tue May 5 16:53:28 CEST 2015


Regarding the API example http://ffmpeg.org/doxygen/trunk/transcode_aac_8c-example.html
this part of the code gave syntax error with c++

/**     * Allocate as many pointers as there are audio channels.     * Each pointer will later point to the audio samples of the corresponding     * channels (although it may be NULL for interleaved formats).     */if (!(*converted_input_samples = calloc(output_codec_context->channels,                                            sizeof(**converted_input_samples)))) { fprintf(stderr, "Could not allocate converted input sample pointers\n"); return AVERROR(ENOMEM);}

I had to change it to :

if (!(**converted_input_samples = (u_int8_t *)calloc(output_codec_context->channels, sizeof(uint8_t))))
but anyway, the call to the function init_converted_samplessend converted_input_samples as NULLso it make a segmentation fault.
How should I fix that segmentation fault?
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150505/d36a53ad/attachment.html>


More information about the Libav-user mailing list