Fix ffms2 video provider to work with new ffms2 version (b6)

Originally committed to SVN as r2774.
This commit is contained in:
Karl Blomster 2009-04-06 20:53:01 +00:00
parent f80421d2e6
commit eed309f187
2 changed files with 11 additions and 11 deletions

View file

@ -55,8 +55,8 @@ FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(Aegisub::String filename, d
// clean up variables // clean up variables
VideoSource = NULL; VideoSource = NULL;
Index = NULL; Index = NULL;
DstFormat = FFMS_PIX_FMT_NONE; DstFormat = PIX_FMT_NONE;
LastDstFormat = FFMS_PIX_FMT_NONE; LastDstFormat = PIX_FMT_NONE;
KeyFramesLoaded = false; KeyFramesLoaded = false;
FrameNumber = -1; FrameNumber = -1;
MessageSize = sizeof(FFMSErrorMessage); MessageSize = sizeof(FFMSErrorMessage);
@ -194,8 +194,8 @@ void FFmpegSourceVideoProvider::Close() {
if (Index) if (Index)
FFMS_DestroyFrameIndex(Index); FFMS_DestroyFrameIndex(Index);
DstFormat = FFMS_PIX_FMT_NONE; DstFormat = PIX_FMT_NONE;
LastDstFormat = FFMS_PIX_FMT_NONE; LastDstFormat = PIX_FMT_NONE;
KeyFramesLoaded = false; KeyFramesLoaded = false;
KeyFramesList.clear(); KeyFramesList.clear();
TimecodesVector.clear(); TimecodesVector.clear();
@ -226,19 +226,19 @@ const AegiVideoFrame FFmpegSourceVideoProvider::GetFrame(int _n, int FormatType)
// choose output format // choose output format
if (FormatType & FORMAT_RGB32 && big_endian) { if (FormatType & FORMAT_RGB32 && big_endian) {
DstFormat = FFMS_PIX_FMT_BGR32_1; DstFormat = PIX_FMT_BGR32_1;
DstFrame.format = FORMAT_RGB32; DstFrame.format = FORMAT_RGB32;
} else if (FormatType & FORMAT_RGB32 && !big_endian) { } else if (FormatType & FORMAT_RGB32 && !big_endian) {
DstFormat = FFMS_PIX_FMT_RGB32; DstFormat = PIX_FMT_RGB32;
DstFrame.format = FORMAT_RGB32; DstFrame.format = FORMAT_RGB32;
} else if (FormatType & FORMAT_RGB24) { } else if (FormatType & FORMAT_RGB24) {
DstFormat = FFMS_PIX_FMT_BGR24; DstFormat = PIX_FMT_BGR24;
DstFrame.format = FORMAT_RGB24; DstFrame.format = FORMAT_RGB24;
} else if (FormatType & FORMAT_YV12) { } else if (FormatType & FORMAT_YV12) {
DstFormat = FFMS_PIX_FMT_YUV420P; // may or may not work DstFormat = PIX_FMT_YUV420P; // may or may not work
DstFrame.format = FORMAT_YV12; DstFrame.format = FORMAT_YV12;
} else if (FormatType & FORMAT_YUY2) { } else if (FormatType & FORMAT_YUY2) {
DstFormat = FFMS_PIX_FMT_YUYV422; DstFormat = PIX_FMT_YUYV422;
DstFrame.format = FORMAT_YUY2; DstFrame.format = FORMAT_YUY2;
} else } else
throw _T("FFmpegSource video provider: upstream provider requested unknown or unsupported pixel format"); throw _T("FFmpegSource video provider: upstream provider requested unknown or unsupported pixel format");

View file

@ -57,8 +57,8 @@ private:
std::vector<int> TimecodesVector; std::vector<int> TimecodesVector;
FrameRate Timecodes; FrameRate Timecodes;
FFMS_PixelFormat DstFormat; PixelFormat DstFormat;
FFMS_PixelFormat LastDstFormat; PixelFormat LastDstFormat;
AegiVideoFrame CurFrame; AegiVideoFrame CurFrame;
char FFMSErrorMessage[1024]; char FFMSErrorMessage[1024];