diff options
Diffstat (limited to 'liboutput')
-rw-r--r-- | liboutput/encode.c | 16 | ||||
-rw-r--r-- | liboutput/encode.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/liboutput/encode.c b/liboutput/encode.c index ae8bff6..c0e33c2 100644 --- a/liboutput/encode.c +++ b/liboutput/encode.c @@ -40,12 +40,13 @@ extern "C" { #include <vdr/device.h> #include <vdr/tools.h> +AVCodec *cEncode::m_pavCodec = NULL; + /******************************************************************************* */ cEncode::cEncode() -: m_pavCodec(NULL) -, m_pImageFilled(NULL) +: m_pImageFilled(NULL) , m_pImageYUV(NULL) , m_nNumberOfFramesToEncode(4) , m_pMPEG(NULL) @@ -55,12 +56,6 @@ cEncode::cEncode() m_nWidth = 720; m_nHeight = m_bUsePAL ? 576 : 480; - m_pavCodec = avcodec_find_encoder(CODEC_ID_MPEG2VIDEO); - if (!m_pavCodec) { - esyslog("imageplugin: Failed to find CODEC_ID_MPEG2VIDEO."); - return; - } - m_pFrameSizes = new unsigned int[m_nNumberOfFramesToEncode]; // Just a wild guess: 3 x output image size should be enough for the MPEG @@ -79,6 +74,11 @@ bool cEncode::Register() avcodec_register_all(); #endif + m_pavCodec = avcodec_find_encoder(CODEC_ID_MPEG2VIDEO); + if (!m_pavCodec) { + esyslog("imageplugin: Failed to find CODEC_ID_MPEG2VIDEO."); + return false; + } return true; } diff --git a/liboutput/encode.h b/liboutput/encode.h index 77437fe..ccbe51b 100644 --- a/liboutput/encode.h +++ b/liboutput/encode.h @@ -38,7 +38,7 @@ extern "C" { class cEncode { - AVCodec *m_pavCodec; + static AVCodec *m_pavCodec; unsigned int m_nMaxMPEGSize; uint8_t *m_pImageFilled; uint8_t *m_pImageYUV; |