title: Crashing in Release Mode and error encounter in Debug Mode
body: <p>Its my first question on stack overflow, so please answer me.</p>
  <p>I am using libvlc library 2.1.5win64 for window 7 with Qt 4.8.5, C++ and Cmake 2.8 to build a project that capture a streaming video from VLC server in rtsp protocol. I am facing two problems very badly.</p>
  <blockquote>
  <p>1: My program is bulding .exe file in Release mode but it crash when we open(double click) this .exe file, while it is working correctly in debug mode.</p>
  <p>2: My program is not working in debug mode also, when I open .exe file it shown a widget but video is not streaming</p>
  </blockquote>
  <p>it encounters a error</p>
  <pre><code>[0000000001c96b20] main input error: open of 'rtsp&quot;//192.168.1.101:8554/' failed 
  
  [0000000001bcce90] main input error: your input can't be opened
  [0000000001bcce90] main input error: VLC is unable to open the MRL 'rtsp://192.168.1.101:8554/'. check the log for details.
  </code></pre>
  <p>Please somebody anserw my question..............</p>
  <p>I am also providing my source code with cmakelist............</p>
  <p>If possible please edit my code because i am new on Qt,Cmake,LibVlc</p>
  <pre><code>CmakeList.txt
  
  
  cmake_minimum_required(VERSION 2.8)
  PROJECT(VlcInterfaceWindow_FULL)
  FIND_PACKAGE( Qt4 4.8.5 COMPONENTS QtMain QtCore QtGui REQUIRED )
  #SET(VlcInterfaceWindow_SOURCES  main.cpp  vlc_on_qt.cpp)
  SET(VlcInterfaceWindow_HEAERS vlc_on_qt.h)
  
  INCLUDE(${QT_USE_FILE})
  include_directories( &quot;C:/vlc-2.1.5/sdk/include&quot;)
  QT4_WRAP_CPP(VlcInterfaceWindow_HEAERS_MOC ${VlcInterfaceWindow_HEAERS})
  
  
  add_library(lib_vlc STATIC IMPORTED)
  set_property(TARGET lib_vlc PROPERTY IMPORTED_LOCATION_RELEASE C:/vlc-2.1.5/sdk/lib/libvlc.lib)
  set_property(TARGET lib_vlc PROPERTY IMPORTED_LOCATION_DEBUG C:/vlc-2.1.5/sdk/lib/libvlc.lib)
  
  add_library(lib_vlc_core STATIC IMPORTED)
  set_property(TARGET lib_vlc_core PROPERTY IMPORTED_LOCATION_RELEASE C:/vlc-    
  2.1.5/sdk/lib/libvlccore.lib)
  set_property(TARGET lib_vlc_core PROPERTY IMPORTED_DEBUG C:/vlc-2.1.5/sdk/lib/libvlccore.lib)
  set(VlcTest_SRCS  main.cpp vlc_on_qt.cpp )
  
  ADD_EXECUTABLE(VlcInterfaceWindow_FULL ${VlcTest_SRCS} ${VlcInterfaceWindow_HEAERS_MOC})
  TARGET_LINK_LIBRARIES(VlcInterfaceWindow_FULL ${QT_LIBRARIES} lib_vlc lib_vlc_core)
  
  
  
  main.cpp
  
  #include &quot;vlc_on_qt.h&quot;
  #include &lt;QtGui/QApplication&gt;
  
  int main(int argc, char *argv[])
  {
  QApplication a(argc, argv);
  Player p;
  p.resize(640,480);
  //p.playFile(&quot;rtsp://38.117.88.90/TenTV/video&quot;);
  p.playFile(&quot;rtsp://192.168.1.101:8554/&quot;);
  p.show();
  return a.exec();
  }
  
  
  
  
  
  vlc_on_qt.h
  
  #ifndef VLC_ON_QT_H
  #define VLC_ON_QT_H
  
  #include &lt;vlc/vlc.h&gt;
  #include &lt;vlc/libvlc.h&gt;
  #include &lt;QWidget&gt;
  
  class 
  QVBoxLayout;
  class
  QTimer;
  class 
  QFrame;
  class
  QSlider;
  
  #define POSITION_RESOLUTION 10000
  
  class Player : public QWidget
  {
  Q_OBJECT
  
  QSlider *_positionSlider;
     
  QFrame *_videoWidget;
  QTimer *poller;
  bool _isPlaying;
  libvlc_instance_t *_vlcinstance;
  libvlc_media_player_t *_mp;
  libvlc_media_t *_m;
  
  public:
  Player();
  </code></pre>
  <p>~Player();</p>
  <pre><code>public slots:
  void playFile(QString file);
  void updateInterface();
  void changePosition(int newPosition);
  };
  #endif
  
  
  
  vlc_on_qt.cpp
  
  #include &quot;vlc_on_qt.h&quot;
  #include &lt;QVBoxLayout&gt;
  #include &lt;QPushButton&gt;
  #include &lt;QSlider&gt;
  #include &lt;QTimer&gt;
  #include &lt;QFrame&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  Player::Player()
  : QWidget()
  {
  
   _videoWidget=new QFrame(this);
  
  _positionSlider=new QSlider(Qt::Horizontal,this); 
  _positionSlider-&gt;setMaximum(POSITION_RESOLUTION);
  
  QVBoxLayout *layout = new QVBoxLayout;
  layout-&gt;addWidget(_videoWidget);
  layout-&gt;addWidget(_positionSlider);
  setLayout(layout);
  
  _isPlaying=false;
  poller=new QTimer(this);
  
  connect(poller, SIGNAL(timeout()),this, SLOT(updateInterface()));
  connect(_positionSlider, SIGNAL(sliderMoved(int)), this, SLOT(changePosition(int)));
  
  poller-&gt;start(100); 
  }
  
  Player::~Player() 
  {
  libvlc_media_player_stop (_mp);
     
  libvlc_media_player_release (_mp);
  
  libvlc_release (_vlcinstance);
  
  }
  
  void Player::playFile(QString file)
  {
   _vlcinstance=libvlc_new(0, NULL);          
  
   //Create a new LibVLC media descriptor
  _m = libvlc_media_new_location(_vlcinstance, file.toAscii());
  
  _mp=libvlc_media_player_new_from_media (_m);
  
  
  // Get our media instance to use our window 
   libvlc_media_player_set_hwnd(_mp, _videoWidget-&gt;winId());
  
  // Play 
  libvlc_media_player_play (_mp);
    
  _isPlaying=true;   
  
  }
  
  
  void Player::changePosition(int newPosition)
  {
  libvlc_media_t *curMedia = libvlc_media_player_get_media (_mp);
  if (curMedia == NULL)
      return;
  
  float pos=(float)(newPosition)/(float)POSITION_RESOLUTION;
  libvlc_media_player_set_position (_mp, pos);
  
  }
  
  void Player::updateInterface()
  {
  if(!_isPlaying)
      return;
  
  libvlc_media_t *curMedia = libvlc_media_player_get_media (_mp);
  if (curMedia == NULL)
      return;
  
  float pos=libvlc_media_player_get_position (_mp);
  int siderPos=(int)(pos*(float)(POSITION_RESOLUTION));
  _positionSlider-&gt;setValue(siderPos);
  
  }
  </code></pre>