mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 08:34:08 +00:00
Merge pull request #997 from vedgy/small-audio-player-fixes
Small audio player fixes
This commit is contained in:
commit
d9980bf662
|
@ -60,14 +60,14 @@ void AudioPlayerFactory::reset()
|
|||
|
||||
if( !internalPlayerBackend.isQtmultimedia() )
|
||||
{
|
||||
if( qobject_cast< Ffmpeg::AudioPlayer * >( playerPtr.data() ) == 0 )
|
||||
if( !playerPtr || !qobject_cast< Ffmpeg::AudioPlayer * >( playerPtr.data() ) )
|
||||
playerPtr.reset( new Ffmpeg::AudioPlayer );
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MAKE_QTMULTIMEDIA_PLAYER
|
||||
if( qobject_cast< MultimediaAudioPlayer * >( playerPtr.data() ) == 0 )
|
||||
if( !playerPtr || !qobject_cast< MultimediaAudioPlayer * >( playerPtr.data() ) )
|
||||
playerPtr.reset( new MultimediaAudioPlayer );
|
||||
return;
|
||||
#endif
|
||||
|
|
|
@ -22,6 +22,11 @@ public:
|
|||
this, SIGNAL( error( QString ) ) );
|
||||
}
|
||||
|
||||
~AudioPlayer()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
virtual QString play( const char * data, int size )
|
||||
{
|
||||
AudioService::instance().playMemory( data, size );
|
||||
|
|
Loading…
Reference in a new issue