MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / init_fifo

Function init_fifo

doc/examples/transcode_aac.c:330–339  ·  view source on GitHub ↗

* Initialize a FIFO buffer for the audio samples to be encoded. * @param[out] fifo Sample buffer * @param output_codec_context Codec context of the output file * @return Error code (0 if successful) */

Source from the content-addressed store, hash-verified

328 * @return Error code (0 if successful)
329 */
330static int init_fifo(AVAudioFifo **fifo, AVCodecContext *output_codec_context)
331{
332 /* Create the FIFO buffer based on the specified output sample format. */
333 if (!(*fifo = av_audio_fifo_alloc(output_codec_context->sample_fmt,
334 output_codec_context->ch_layout.nb_channels, 1))) {
335 fprintf(stderr, "Could not allocate FIFO\n");
336 return AVERROR(ENOMEM);
337 }
338 return 0;
339}
340
341/**
342 * Write the header of the output file container.

Callers 1

mainFunction · 0.85

Calls 1

av_audio_fifo_allocFunction · 0.85

Tested by

no test coverage detected