Ticket #9169: autoplay-cdaudio.diff

File autoplay-cdaudio.diff, 2.3 KB (added by lvr@…, 10 years ago)

Fix autoplay of mixed audiocd/data disks

  • mythtv/libs/libmyth/mythcdrom-linux.cpp

     
    1919#define LOC_ERR QString("MythCDROMLinux, Error: ")
    2020
    2121// On a mixed-mode disc (audio+data), set this to 0 to mount the data portion:
     22#ifndef ASSUME_WANT_AUDIO
    2223#define ASSUME_WANT_AUDIO 1
     24#endif
    2325
    2426
    2527// Some features cannot be detected (reliably) using the standard
     
    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        VERBOSE(VB_MEDIA+VB_EXTRA, "Disc is unmountable?");
    436447        if (OpenedHere)
    437448            closeDevice();
     
    510521            }
    511522            case CDS_AUDIO:
    512523                VERBOSE(VB_MEDIA, "found an audio disk");
     524                // pretend we're NOTMOUNTED so setStatus emits a signal
     525                m_Status = MEDIASTAT_NOTMOUNTED;
    513526                m_MediaType = MEDIATYPE_AUDIO;
    514527                return setStatus(MEDIASTAT_USEABLE, OpenedHere);
    515528                break;
    516529            case CDS_MIXED:
    517                 m_MediaType = MEDIATYPE_MIXED;
    518530                VERBOSE(VB_MEDIA, "found a mixed CD");
    519531                // Note: Mixed mode CDs require an explixit mount call
    520532                //       since we'll usually want the audio portion.
    521533                // undefine ASSUME_WANT_AUDIO to change this behavior.
    522                 #ifdef ASSUME_WANT_AUDIO
     534                #if ASSUME_WANT_AUDIO
     535                    // pretend we're NOTMOUNTED so setStatus emits a signal
     536                    m_Status = MEDIASTAT_NOTMOUNTED;
     537                    m_MediaType = MEDIATYPE_AUDIO;
    523538                    return setStatus(MEDIASTAT_USEABLE, OpenedHere);
    524539                #else
     540                    m_MediaType = MEDIATYPE_MIXED;
    525541                    mount();
    526542                    if (isMounted())
    527543                    {