summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Harrison <pharrison@mythtv.org>2011-02-17 16:28:43 (GMT)
committer Paul Harrison <pharrison@mythtv.org>2011-02-17 16:28:43 (GMT)
commit23eff84c01c4494e2961b1ba0494c45e80d36053 (patch)
tree2bd0fb1905dce3e30edc6673aafe120a7b7ffe22
parent7df45359e597d5018a59f877ab45377474c40c58 (diff)
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.
-rw-r--r--mythplugins/mythmusic/mythmusic/musicplayer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/mythplugins/mythmusic/mythmusic/musicplayer.cpp b/mythplugins/mythmusic/mythmusic/musicplayer.cpp
index da146d6..6b05a11 100644
--- a/mythplugins/mythmusic/mythmusic/musicplayer.cpp
+++ b/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);