From d93eb3cc328a382cb213545410879a27fe1dd802 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Sun, 26 May 2013 23:00:53 +0100 Subject: [PATCH] MythMusic: don't use cdio_paranoia for CD playback There is problem with cdio_paranoia_read_limited() getting stuck in a loop if the CD is ejected while playing. In theory it should give up after a set number of retries but that doesn't seem to be working in the latest version. I tried to lock the CD tray while playing but while the media monitor supports locking it doesn't appear to be working :( so the easiest solution for now is to use the non paranoia cdio routines which do detect an ejected CD properly. --- mythplugins/mythmusic/mythmusic/cddecoder.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mythplugins/mythmusic/mythmusic/cddecoder.cpp b/mythplugins/mythmusic/mythmusic/cddecoder.cpp index ac793b283f8..c7466b549b9 100644 --- a/mythplugins/mythmusic/mythmusic/cddecoder.cpp +++ b/mythplugins/mythmusic/mythmusic/cddecoder.cpp @@ -231,7 +231,10 @@ bool CdDecoder::initialize() m_end = end2; } - m_paranoia = cdio_paranoia_init(m_device); + // FIXME can't use cdio_paranoia until we find a way to cleanly + // detect when the user has ejected a CD otherwise we enter a + // recursive loop in cdio_paranoia_read_limited() + //m_paranoia = cdio_paranoia_init(m_device); if (NULL != m_paranoia) { cdio_paranoia_modeset(m_paranoia, PARANOIA_MODE_DISABLE); @@ -239,7 +242,7 @@ bool CdDecoder::initialize() } else { - LOG(VB_GENERAL, LOG_ERR, "Warn: CD reading with paranoia is disabled"); + LOG(VB_GENERAL, LOG_WARNING, "CD reading with paranoia is disabled"); } } else @@ -375,6 +378,9 @@ void CdDecoder::run() arg(m_curpos).arg(c)); memset( &m_output_buf[m_output_at], 0, CDIO_CD_FRAMESIZE_RAW); + + // stop if we got an error + m_user_stop = true; } }