Permalink
Browse files

Fix a segfault in MusicPlayer::decoderHandlerReady().

Any track with 'cda' in the filename was causing problems. This just uses a
more sane way to detect if the decoder is a Cddecoder. Fixes #9591.
(cherry picked from commit 23eff84)
  • Loading branch information...
1 parent 90f48c8 commit 84db96ce569d62da8eeea6ec1aa2e6f56cb34c09 Paul Harrison committed Feb 17, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 mythplugins/mythmusic/mythmusic/musicplayer.cpp
@@ -993,8 +993,9 @@ void MusicPlayer::decoderHandlerReady(void)
VERBOSE(VB_PLAYBACK, QString ("decoder handler is ready, decoding %1").
arg(getDecoder()->getFilename()));
- if (getDecoder()->getFilename().contains("cda") == 1)
- dynamic_cast<CdDecoder*>(getDecoder())->setDevice(m_CDdevice);
+ CdDecoder *cddecoder = dynamic_cast<CdDecoder*>(getDecoder());
+ if (cddecoder)
+ cddecoder->setDevice(m_CDdevice);
getDecoder()->setOutput(m_output);
//getDecoder()-> setBlockSize(2 * 1024);

0 comments on commit 84db96c

Please sign in to comment.