I'm using Ubuntu 10.04 OS with version 1.1.0-rc4 installed. I was trying to build a "Create player" method which returns 1 when nothing wrong was detected and ERROR when some error was detected (ERROR was defined with -1). The problem is... When i try to pass the mrl = " " or anything invalid (invalid path, invalid file type, etc...) the method DOESN'T return ERROR. NEVER.
I also tried some other methods, like the "libvlc_media_player_will_play(this->player)" after the "libvlc_media_player_new_from_media(this->media)" and the return was 0 ALWAYS (both when mrl was valid and invalid).
P.S - The code of the method is show below. He compiles and executes very well, but no error handling working.
Code: Select all
int playerImpl::createPlayer(std::string mrl, bool audio) {
int numArgumentos = 0;
const char* argumentos[4];
if(audio == false){
numArgumentos = 3;
argumentos[0] = "--no-audio";
argumentos[1] = "--no-video-title-show";
argumentos[2] = "--quiet";
}
else {
numArgumentos = 2;
argumentos[0] = "--no-video-title-show";
argumentos[1] = "--quiet";
}
this->instancia = libvlc_new(numArgumentos, argumentos);
if(this->instancia == NULL) {
return ERROR;
}
this->media = libvlc_media_new_location(this->instancia,mrl.c_str());
if(this->media == NULL) {
return ERROR;
}
this->player = libvlc_media_player_new_from_media(this->media);
if(this->player == NULL) {
return ERROR;
}
libvlc_media_release(this->media);
return 1;
}