* 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) */
| 328 | * @return Error code (0 if successful) |
| 329 | */ |
| 330 | static 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. |
no test coverage detected