MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ close()

void MayaFlux::IO::AudioEncodeContext::close ( )

Release all owned resources.

Safe to call multiple times or on a context that never opened.

Definition at line 26 of file AudioEncodeContext.cpp.

27{
28 if (fifo) {
29 av_audio_fifo_free(fifo);
30 fifo = nullptr;
31 }
32 if (swr_context) {
33 swr_free(&swr_context);
34 swr_context = nullptr;
35 }
36 if (codec_context) {
37 avcodec_free_context(&codec_context);
38 codec_context = nullptr;
39 }
40 stream = nullptr;
41 m_stream_index = -1;
42 m_sample_rate = 0;
43 m_channels = 0;
44 m_pts = 0;
45 m_last_error.clear();
46}
AVCodecContext * codec_context
Owned; freed in destructor.
SwrContext * swr_context
Owned; freed in destructor.
AVAudioFifo * fifo
Owned; freed in destructor.
AVStream * stream
Owned by mux; pointer cached here.

References codec_context, fifo, m_channels, m_last_error, m_pts, m_sample_rate, m_stream_index, stream, and swr_context.

Referenced by open(), and ~AudioEncodeContext().

+ Here is the caller graph for this function: