mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 12:44:07 +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( !internalPlayerBackend.isQtmultimedia() )
|
||||||
{
|
{
|
||||||
if( qobject_cast< Ffmpeg::AudioPlayer * >( playerPtr.data() ) == 0 )
|
if( !playerPtr || !qobject_cast< Ffmpeg::AudioPlayer * >( playerPtr.data() ) )
|
||||||
playerPtr.reset( new Ffmpeg::AudioPlayer );
|
playerPtr.reset( new Ffmpeg::AudioPlayer );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAKE_QTMULTIMEDIA_PLAYER
|
#ifdef MAKE_QTMULTIMEDIA_PLAYER
|
||||||
if( qobject_cast< MultimediaAudioPlayer * >( playerPtr.data() ) == 0 )
|
if( !playerPtr || !qobject_cast< MultimediaAudioPlayer * >( playerPtr.data() ) )
|
||||||
playerPtr.reset( new MultimediaAudioPlayer );
|
playerPtr.reset( new MultimediaAudioPlayer );
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,6 +22,11 @@ public:
|
||||||
this, SIGNAL( error( QString ) ) );
|
this, SIGNAL( error( QString ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~AudioPlayer()
|
||||||
|
{
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
|
||||||
virtual QString play( const char * data, int size )
|
virtual QString play( const char * data, int size )
|
||||||
{
|
{
|
||||||
AudioService::instance().playMemory( data, size );
|
AudioService::instance().playMemory( data, size );
|
||||||
|
|
Loading…
Reference in a new issue