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.
  • Loading branch information...
Paul Harrison
Paul Harrison committed Feb 17, 2011
1 parent 7df4535 commit 23eff84c01c4494e2961b1ba0494c45e80d36053
Showing with 3 additions and 2 deletions.
  1. +3 −2 mythplugins/mythmusic/mythmusic/musicplayer.cpp
@@ -1081,8 +1081,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 23eff84

Please sign in to comment.