Ticket #10296: 0002-libmythbase-Handle-mixed-mode-audio-data-CDs.patch

File 0002-libmythbase-Handle-mixed-mode-audio-data-CDs.patch, 3.0 KB (added by Lawrence Rust <lvr@…>, 13 years ago)
  • mythtv/libs/libmythbase/mythcdrom-linux.cpp

    From 6ca074492c815d8bab05d44b6a966283788f433d Mon Sep 17 00:00:00 2001
    From: Lawrence Rust <lvr@softsystem.co.uk>
    Date: Mon, 30 Jan 2012 20:51:38 +0100
    Subject: [PATCH 2/3] libmythbase: Handle mixed-mode (audio+data) CDs
    
    This fixes a bug in mythcdrom-linux.cpp which currently announces
    the data portion of a mixed mode CD rather than the audio.  This change
    enables MythMusic to autoplay the CD audio.
    
    Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
    ---
     mythtv/libs/libmythbase/mythcdrom-linux.cpp |   20 ++++++++++++++++++--
     1 files changed, 18 insertions(+), 2 deletions(-)
    
    diff --git a/mythtv/libs/libmythbase/mythcdrom-linux.cpp b/mythtv/libs/libmythbase/mythcdrom-linux.cpp
    index 309aed8..1069318 100644
    a b  
    2323#define LOC     QString("MythCDROMLinux:")
    2424
    2525// On a mixed-mode disc (audio+data), set this to 0 to mount the data portion:
     26#ifndef ASSUME_WANT_AUDIO
    2627#define ASSUME_WANT_AUDIO 1
     28#endif
    2729
    2830
    2931// Some features cannot be detected (reliably) using the standard
    MythMediaStatus MythCDROMLinux::checkMedia() 
    432434    // If we have tried to mount and failed, don't keep trying
    433435    if (m_Status == MEDIASTAT_ERROR)
    434436    {
     437        // Check if an external agent (like Gnome/KDE) mounted the disk
     438        if (isMounted())
     439        {
     440            onDeviceMounted();
     441            // pretend we're NOTMOUNTED so setStatus emits a signal
     442            m_Status = MEDIASTAT_NOTMOUNTED;
     443            return setStatus(MEDIASTAT_MOUNTED, OpenedHere);
     444        }
     445
    435446        LOG(VB_MEDIA, LOG_DEBUG, "Disc is unmountable?");
    436447        if (OpenedHere)
    437448            closeDevice();
    MythMediaStatus MythCDROMLinux::checkMedia() 
    537548            }
    538549            case CDS_AUDIO:
    539550                LOG(VB_MEDIA, LOG_DEBUG, "found an audio disk");
     551                // pretend we're NOTMOUNTED so setStatus emits a signal
     552                m_Status = MEDIASTAT_NOTMOUNTED;
    540553                m_MediaType = MEDIATYPE_AUDIO;
    541554                return setStatus(MEDIASTAT_USEABLE, OpenedHere);
    542555                break;
    543556            case CDS_MIXED:
    544                 m_MediaType = MEDIATYPE_MIXED;
    545557                LOG(VB_MEDIA, LOG_DEBUG, "found a mixed CD");
    546558                // Note: Mixed mode CDs require an explixit mount call
    547559                //       since we'll usually want the audio portion.
    548560                // undefine ASSUME_WANT_AUDIO to change this behavior.
    549                 #ifdef ASSUME_WANT_AUDIO
     561                #if ASSUME_WANT_AUDIO
     562                    // pretend we're NOTMOUNTED so setStatus emits a signal
     563                    m_Status = MEDIASTAT_NOTMOUNTED;
     564                    m_MediaType = MEDIATYPE_AUDIO;
    550565                    return setStatus(MEDIASTAT_USEABLE, OpenedHere);
    551566                #else
     567                    m_MediaType = MEDIATYPE_MIXED;
    552568                    mount();
    553569                    if (isMounted())
    554570                    {