void vlcExceptionRaised() { if (libvlc_exception_raised(vlc_exception)) { qDebug() << "libvlc exception:" << libvlc_exception_get_message(vlc_exception); libvlc_exception_clear(vlc_exception); } }
static void catchError(libvlc_exception_t *ex) { if(libvlc_exception_raised(ex)) { fprintf(stderr, "exception: %s\n", libvlc_exception_get_message(ex)); //exit(1); } libvlc_exception_clear(ex); }
static void raise(libvlc_exception_t * ex) { if (libvlc_exception_raised (ex)) { fprintf (stderr, "error: %s\n", libvlc_exception_get_message(ex)); exit (-1); } }
void checkException() { if( libvlc_exception_raised( p_vlc_exception ) ) { qDebug() << "libvlc exception:" << libvlc_exception_get_message( p_vlc_exception ); libvlc_exception_clear( p_vlc_exception ); } }
static void ProcessVLCException(libvlc_exception_t* ex, VLCExceptionHandler eh) { if(libvlc_exception_raised(ex) && eh) { char szErrorMsg[1024]=""; sprintf(szErrorMsg, "%s", libvlc_exception_get_message(ex)); libvlc_exception_clear(ex); eh(szErrorMsg); } }
static void clutter_vlc_catch(libvlc_exception_t* vlc_exception) { /* well this is really bad. Find out another way to handle vlc exceptions */ if (libvlc_exception_raised(vlc_exception)) { fprintf(stderr, "exception: %s\n", libvlc_exception_get_message(vlc_exception)); exit(1); } libvlc_exception_clear(vlc_exception); }
void VlcTagger::handleException() { #if LIBVLC_VERSION_INT < 0x110 if (libvlc_exception_raised(_pException)) { LOGNS(Omm::Av, upnpav, error, "vlc tagger: " + std::string(libvlc_exception_get_message(_pException))); } libvlc_exception_init(_pException); #else const char* errMsg = libvlc_errmsg(); if (errMsg) { LOGNS(Omm::Av, upnpav, error, "vlc tagger: " + std::string(errMsg)); } #endif }
RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVariant &result) { /* is plugin still running */ if( isPluginRunning() ) { VlcPlugin* p_plugin = getPrivate<VlcPlugin>(); libvlc_exception_t ex; libvlc_exception_init(&ex); libvlc_media_player_t *p_md = p_plugin->getMD(&ex); if( libvlc_exception_raised(&ex) ) { if( index != ID_input_state ) { NPN_SetException(this, libvlc_exception_get_message(&ex)); libvlc_exception_clear(&ex); return INVOKERESULT_GENERIC_ERROR; } else { /* for input state, return CLOSED rather than an exception */ INT32_TO_NPVARIANT(0, result); libvlc_exception_clear(&ex); return INVOKERESULT_NO_ERROR; } } switch( index ) { case ID_input_length: { double val = (double)libvlc_media_player_get_length(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); DOUBLE_TO_NPVARIANT(val, result); return INVOKERESULT_NO_ERROR; } case ID_input_position: { double val = libvlc_media_player_get_position(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); DOUBLE_TO_NPVARIANT(val, result); return INVOKERESULT_NO_ERROR; } case ID_input_time: { double val = (double)libvlc_media_player_get_time(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); DOUBLE_TO_NPVARIANT(val, result); return INVOKERESULT_NO_ERROR; } case ID_input_state: { int val = libvlc_media_player_get_state(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); INT32_TO_NPVARIANT(val, result); return INVOKERESULT_NO_ERROR; } case ID_input_rate: { float val = libvlc_media_player_get_rate(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); DOUBLE_TO_NPVARIANT(val, result); return INVOKERESULT_NO_ERROR; } case ID_input_fps: { double val = libvlc_media_player_get_fps(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); DOUBLE_TO_NPVARIANT(val, result); return INVOKERESULT_NO_ERROR; } case ID_input_hasvout: { bool val = p_plugin->player_has_vout(&ex); RETURN_ON_EXCEPTION(this,ex); BOOLEAN_TO_NPVARIANT(val, result); return INVOKERESULT_NO_ERROR; } default: ; } } return INVOKERESULT_GENERIC_ERROR; }