i am writing a simple program using VS C++ (2008) to run video stream using the new VLC 0.9.8a version and having problem to instantiate vlc - eg: it stops at libvlc = libvlc_new(vlc_argc, vlc_argv, &ex);
Below is my source code...any input or help would be appreciated...
thanks
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "vlc.h"
#include "libvlc.h"
#include "libvlc_structures.h"
#include "libvlc_events.h"
static void except (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);
}
int main(int argc, char *argv[])
{
libvlc_exception_t ex;
libvlc_instance_t *libvlc;
libvlc_media_t *m;
libvlc_media_player_t *mp;
char const *vlc_argv[] = {
"-q",
"--plugin-path", "C://My Documents//Visual Studio 2008//Projects//My_VCL//Debug//plugins",
"--ignore-config", /* Don't use VLC's config files */
"--noaudio", //disable audio
"--fullscreen",
};
int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
libvlc_exception_init(&ex);
libvlc = libvlc_new(vlc_argc, vlc_argv, &ex);
except(&ex);
m = libvlc_media_new(libvlc, "C://Test.mpg", &ex);
except(&ex);
mp = libvlc_media_player_new_from_media(m, &ex);
except(&ex);
libvlc_media_release(m);
libvlc_media_player_play(mp, &ex);
except(&ex);
/*
* Stop stream and clean up libVLC
*/
libvlc_media_player_stop(mp, &ex);
except(&ex);
libvlc_media_player_release(mp);
libvlc_release(libvlc);
return 0;
}