diff --git a/core/ass_file.cpp b/core/ass_file.cpp index f6d31e9aa..ae18aa9fc 100644 --- a/core/ass_file.cpp +++ b/core/ass_file.cpp @@ -187,10 +187,12 @@ wxString AssFile::GetString() { using std::list; wxString ret; AssEntry *entry; + ret += 0xfeff; for (list::iterator cur=Line.begin();cur!=Line.end();) { entry = *cur; ret += entry->GetEntryData(); ret += L"\n"; + cur++; } return ret; } diff --git a/core/subtitle_provider_asa.cpp b/core/subtitle_provider_asa.cpp index fff6f3921..d4347d551 100644 --- a/core/subtitle_provider_asa.cpp +++ b/core/subtitle_provider_asa.cpp @@ -79,11 +79,10 @@ SubtitleProviderASA::MyClass SubtitleProviderASA::me; SubtitleProviderASA::SubtitleProviderASA(AssFile *_subs) { - const wxChar *cstr; - subs = _subs; - cstr = subs->GetString().c_str(); - inst = asa_open_mem((const char *)cstr, wcslen(cstr), (enum asa_oflags)0); + wxString text = subs->GetString(); + + inst = asa_open_mem((const char *)text.GetData(), sizeof(wchar_t) * text.Length(), (enum asa_oflags)0); if (!inst) throw L"failed to load script with asa."; }; @@ -111,7 +110,7 @@ void SubtitleProviderASA::Render(wxImage &frame, int ms) aframe.csp = ASACSP_RGB; aframe.bmp.rgb.fmt = ASACSPR_RGB; aframe.bmp.rgb.d.d = frame.GetData(); - aframe.bmp.rgb.d.stride = frame.GetWidth(); + aframe.bmp.rgb.d.stride = 3 * frame.GetWidth(); asa_render(inst, ms * 0.001, &aframe); }