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:30:48 (GMT)
commit84db96ce569d62da8eeea6ec1aa2e6f56cb34c09 (patch)
tree8b712f96a15cb5577b05dc33cd9d6609807020fe
parent90f48c8ffd9681d79bd5d3c48c6b5e42172c967c (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. (cherry picked from commit 23eff84c01c4494e2961b1ba0494c45e80d36053)
-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 fd03249..9f92a42 100644
--- a/mythplugins/mythmusic/mythmusic/musicplayer.cpp
+++ b/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);