Kaydet (Commit) ba282259 authored tarafından Minh Ngo's avatar Minh Ngo

Fixing warnings and crash with the VLC::Instance.

Change-Id: I0282b79e296d6fccafbf7d89f38ed2f50672ef08
üst 77d73276
......@@ -12,26 +12,29 @@ using namespace ::com::sun::star;
namespace avmedia {
namespace vlc {
const ::rtl::OUString AVMEDIA_VLC_PLAYER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Player_VLC";
const ::rtl::OUString AVMEDIA_VLC_PLAYER_SERVICENAME = "com.sun.star.media.Player_VLC";
namespace
{
const ::rtl::OUString AVMEDIA_VLC_PLAYER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Player_VLC";
const ::rtl::OUString AVMEDIA_VLC_PLAYER_SERVICENAME = "com.sun.star.media.Player_VLC";
const char * const VLC_ARGS[] = {
"-Vdummy",
"--snapshot-format=png",
"--ffmpeg-threads",
"--verbose=2"
};
const int MS_IN_SEC = 1000; // Millisec in sec
const int MS_IN_SEC = 1000; // Millisec in sec
const char * const VLC_ARGS[] = {
"-Vdummy",
"--snapshot-format=png",
"--ffmpeg-threads",
"--verbose=2"
};
}
VLCPlayer::VLCPlayer( const rtl::OUString& url, boost::shared_ptr<VLC::EventHandler> eh )
VLCPlayer::VLCPlayer( const rtl::OUString& iurl, boost::shared_ptr<VLC::EventHandler> eh )
: VLC_Base(m_aMutex)
, mEventHandler( eh )
, mInstance( VLC_ARGS )
, mMedia( url, mInstance )
, mInstance( sizeof( VLC_ARGS ) / sizeof( VLC_ARGS[0] ), VLC_ARGS )
, mMedia( iurl, mInstance )
, mPlayer( mMedia )
, mEventManager( mPlayer, mEventHandler )
, mUrl( url )
, mUrl( iurl )
, mPlaybackLoop( false )
{
mPlayer.setMouseHandling(false);
......
......@@ -49,7 +49,7 @@ class VLCPlayer : public ::cppu::BaseMutex,
const rtl::OUString mUrl;
bool mPlaybackLoop;
public:
VLCPlayer( const rtl::OUString& url, boost::shared_ptr<VLC::EventHandler> eh );
VLCPlayer( const rtl::OUString& iurl, boost::shared_ptr<VLC::EventHandler> eh );
const rtl::OUString& url() const;
......
......@@ -26,15 +26,18 @@ namespace VLC
};
}
Instance::Instance( const char * const argv[] )
Instance::Instance( int argc, const char * const argv[] )
{
InitApiMap( VLC_INSTANCE_API );
mInstance = libvlc_new( sizeof( argv ) / sizeof( argv[0] ), argv );
mInstance = libvlc_new( argc, argv );
}
Instance::Instance( const Instance& other )
{
libvlc_release( mInstance );
mInstance = other.mInstance;
libvlc_retain( mInstance );
}
const Instance& Instance::operator=( const Instance& other )
......@@ -42,6 +45,7 @@ namespace VLC
libvlc_release( mInstance );
mInstance = other.mInstance;
libvlc_retain( mInstance );
return *this;
}
Instance::~Instance()
......
......@@ -14,10 +14,12 @@ struct libvlc_instance_t;
namespace VLC
{
class Instance
{
public:
Instance( const char * const argv[] );
Instance( int argc, const char * const argv[] );
Instance( const Instance& other );
const Instance& operator=( const Instance& other );
virtual ~Instance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment