Postby brushhead » 28 Nov 2011 21:24
Hello Rémi,
Thanks for responding. Been at Uni today and not been able to respond.
I did some more reading and I think i've got code that'll work.
I am calling in sequence:
// Define pointers and set them NULL.
//
libvlc_media_list_t* MediaListing = NULL;
libvlc_instance_t * VLC_Inst = NULL;
libvlc_media_t *Media = NULL;
libvlc_media_player_t * ThePlayer = NULL;
libvlc_media_list_player_t * ListPlayer = NULL;
int Loop = 0;
// First thing's first.
//
VLC_Inst = libvlc_new(0, NULL);
// Create a new media listing based on our player object.
//
MediaListing = libvlc_media_list_new(VLC_Inst);
//Create the list player.
//
ListPlayer = libvlc_media_list_player_new(VLC_Inst);
// The main player to which we will tie to the xwindow.
//
ThePlayer = libvlc_media_player_new(VLC_Inst);
// Build up media listing for list_player
//
while(ChannelsData[Loop].MulticastAddress !=NULL){
Media = libvlc_media_new_path(VLC_Inst, ChannelsData[Loop].MulticastAddress);
libvlc_media_list_add_media(MediaListing, Media);
Loop++;
}
// Point the media list at our media list player. This is the crucial bit I think I missed.
//
libvlc_media_list_player_set_media_player(ListPlayer, ThePlayer);
// Get the handle to the main window.
//
xwin = GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window);
// Set the window into which our video will be played.
//
libvlc_media_player_set_xwindow ( ThePlayer, xwin);
// Start the player off based on our media listing.
//
libvlc_media_list_player_play(ListPlayer);
I think i've got this right but thought it might be helpful to post some code. I'm running 1.1.3 on Debian Squeeze. I did try and build VLC from source but found it quite difficult. Am looking forward to 1.2 because of the enhanced DVD navitation functions.
Thanks,
Rob.
Robert Wilson,
Robstech Consulting Ltd,