Handle libass messages with wxLog* family of functions

Originally committed to SVN as r4357.
This commit is contained in:
Grigori Goronzy 2010-05-24 03:41:06 +00:00
parent 8f67d48487
commit e9c806d0de
1 changed files with 12 additions and 0 deletions

View File

@ -60,6 +60,17 @@ extern "C" {
/// @brief Handle libass messages
///
static void msg_callback(int level, const char *fmt, va_list args, void *data) {
if (level < 2) // warning/error
wxVLogWarning(fmt, args);
else if (level < 7) // verbose
wxVLogDebug(fmt, args);
}
/// @brief Constructor
///
LibassSubtitlesProvider::LibassSubtitlesProvider() {
@ -77,6 +88,7 @@ LibassSubtitlesProvider::LibassSubtitlesProvider() {
ass_set_fonts_dir(ass_library, fonts_dir.mb_str(wxConvFile));
ass_set_extract_fonts(ass_library, 0);
ass_set_style_overrides(ass_library, NULL);
ass_set_message_cb(ass_library, msg_callback, this);
first = false;
}