Ok, here more code about my test:
libvlc_exception_t m_vlcExc;
libvlc_instance_t * m_pLibVlc;
libvlc_media_player_t * m_pMediaPlayer;
libvlc_media_t * m_pMedia;
/* FUNCTION ******************************************************************/
bool VlcLib::Check4Exc (libvlc_exception_t *pExc)
{
if (libvlc_exception_raised (pExc))
{
strncpy (m_szError, libvlc_exception_get_message(pExc), sizeof (m_szError) - 1);
DIAG1(TM_ERROR,"VlcLib::Check4Exc exception raised %s", m_szError);
fprintf (stderr, "Check4Exc error: %s\n", m_szError);
return false;
}
libvlc_exception_clear (pExc);
*m_szError = 0;
return true;
}
/* FUNCTION ******************************************************************/
bool VlcLib::VLCInit (void)
{
libvlc_exception_init (&m_vlcExc);
m_pLibVlc = libvlc_new (0, 0, &m_vlcExc);
if (!m_pLibVlc || !Check4Exc (&m_vlcExc))
{
DIAG(TM_ERROR,"VlcLib::VLCInit libvlc_new failed");
m_iError = ERROR_LIBVLC_NEW;
return false;
}
return true;
}
/* FUNCTION ******************************************************************/
bool VlcLib::CreateMediaPlayer (const char *psz_MRL)
{
DIAG1(TM_INFO,"VlcLib::CreateMediaPlayer with %s +++", psz_MRL);
m_pMedia = libvlc_media_new (m_pLibVlc, psz_MRL, &m_vlcExc);
if (!Check4Exc (&m_vlcExc))
{
DIAG(TM_ERROR,"VlcLib::CreateMediaPlayer failed");
m_iError = ERROR_LIBVLC_CREATEMEDIA;
return false;
}
m_pMediaPlayer = libvlc_media_player_new_from_media (m_pMedia, &m_vlcExc);
if (!Check4Exc (&m_vlcExc))
{
DIAG(TM_ERROR,"VlcLib::CreateMediaPlayer failed");
m_iError = ERROR_LIBVLC_CREATEMEDIA;
return false;
}
libvlc_media_release (m_pMedia);
DIAG(TM_INFO,"VlcLib::CreateMediaPlayer ---");
return true;
}
/* FUNCTION ******************************************************************/
bool VlcLib::PlayMediaPlayer (void)
{
DIAG(TM_INFO,"VlcLib::PlayMediaPlayer +++");
libvlc_media_player_play (m_pMediaPlayer, &m_vlcExc);
if (!Check4Exc (&m_vlcExc))
{
DIAG(TM_ERROR,"VlcLib::Play libvlc_playlist_play failed");
m_iError = ERROR_LIBVLC_PLAY;
return false;
}
DIAG(TM_INFO,"VlcLib::PlayMediaPlayer ---");
return true;
}
The call sequence is:
VLCInit ():
CreateMediaPlayer ("rtp://@224.0.0.21:1234");
PlayMediaPlayer (void);
My system is debian lenny 64bit. The input stream is an ATSC RTP-MPEG2-TS. When I use the vlc-gui it works. I'll try to debug. But hints are welcome