diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 9aa9e5caae..b0648a512d 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -83,7 +83,7 @@ static int getPixelFormatBytes(int pspFormat) } } -MediaEngine::MediaEngine(): m_pdata(0), m_streamSize(0), m_readSize(0){ +MediaEngine::MediaEngine(): m_streamSize(0), m_readSize(0), m_pdata(0) { m_pFormatCtx = 0; m_pCodecCtx = 0; m_pFrame = 0; @@ -298,16 +298,16 @@ bool MediaEngine::setVideoDim(int width, int height) m_pFrame = avcodec_alloc_frame(); m_sws_ctx = NULL; - m_sws_fmt = (AVPixelFormat)-1; + m_sws_fmt = -1; updateSwsFormat(TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888); // Allocate video frame for RGB24 m_pFrameRGB = avcodec_alloc_frame(); - int numBytes = avpicture_get_size(m_sws_fmt, m_desWidth, m_desHeight); + int numBytes = avpicture_get_size((AVPixelFormat)m_sws_fmt, m_desWidth, m_desHeight); m_buffer = (u8*)av_malloc(numBytes * sizeof(uint8_t)); // Assign appropriate parts of buffer to image planes in pFrameRGB - avpicture_fill((AVPicture *)m_pFrameRGB, m_buffer, m_sws_fmt, m_desWidth, m_desHeight); + avpicture_fill((AVPicture *)m_pFrameRGB, m_buffer, (AVPixelFormat)m_sws_fmt, m_desWidth, m_desHeight); #endif // USE_FFMPEG return true; } @@ -326,7 +326,7 @@ void MediaEngine::updateSwsFormat(int videoPixelMode) { pCodecCtx->pix_fmt, m_desWidth, m_desHeight, - m_sws_fmt, + (AVPixelFormat)m_sws_fmt, SWS_BILINEAR, NULL, NULL, diff --git a/Core/HW/MediaEngine.h b/Core/HW/MediaEngine.h index c08d86413d..958518cba1 100644 --- a/Core/HW/MediaEngine.h +++ b/Core/HW/MediaEngine.h @@ -30,7 +30,6 @@ #include "ChunkFile.h" #include "Core/HW/MpegDemux.h" -enum AVPixelFormat; struct SwsContext; struct AVFrame; @@ -78,7 +77,7 @@ public: void *m_pIOContext; int m_videoStream; SwsContext *m_sws_ctx; - AVPixelFormat m_sws_fmt; + int m_sws_fmt; u8 *m_buffer; int m_desWidth;