Make FFMS2 error reporting work.

Originally committed to SVN as r6147.
This commit is contained in:
Niels Martin Hansen 2011-12-23 01:20:33 +00:00
parent a514e92571
commit b955ad1c52
1 changed files with 3 additions and 1 deletions

View File

@ -309,7 +309,9 @@ const AegiVideoFrame FFmpegSourceVideoProvider::GetFrame(int _n) {
// decode frame
const FFMS_Frame *SrcFrame = FFMS_GetFrame(VideoSource, n, &ErrInfo);
if (SrcFrame == NULL) {
ErrorMsg.Append(wxString::Format(_T("Failed to retrieve frame: %s"), ErrInfo.Buffer));
wxString reason_str(ErrInfo.Buffer, wxConvUTF8, ErrInfo.BufferSize);
if (ErrInfo.BufferSize > 0) reason_str.Prepend(_T(": "));
ErrorMsg.Append(wxString::Format(_T("Failed to retrieve frame, error %d.%d%s"), ErrInfo.ErrorType, ErrInfo.SubType, reason_str.c_str()));
throw ErrorMsg;
}