Error handling

This forum is about all development around libVLC.
Trojahn
New Cone
New Cone
Posts: 1
Joined: 22 Jun 2010 15:42

Error handling

Postby Trojahn » 22 Jun 2010 15:59

Hello all..

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; }
Thx for all answers!

michikommader
New Cone
New Cone
Posts: 6
Joined: 15 May 2013 15:16

Re: Error handling

Postby michikommader » 10 Jul 2013 11:40

Anything new on this? libvlc_media_player_will_play indeed always returns 0. I also want to check if the player was created successfully from my media or not. The documentation does not tell anything about this functions and possible cases for different return values.

Michi


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests