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
|
|
23 | 23 | #define LOC QString("MythCDROMLinux:") |
24 | 24 | |
25 | 25 | // On a mixed-mode disc (audio+data), set this to 0 to mount the data portion: |
| 26 | #ifndef ASSUME_WANT_AUDIO |
26 | 27 | #define ASSUME_WANT_AUDIO 1 |
| 28 | #endif |
27 | 29 | |
28 | 30 | |
29 | 31 | // Some features cannot be detected (reliably) using the standard |
… |
… |
MythMediaStatus MythCDROMLinux::checkMedia() |
432 | 434 | // If we have tried to mount and failed, don't keep trying |
433 | 435 | if (m_Status == MEDIASTAT_ERROR) |
434 | 436 | { |
| 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 | |
435 | 446 | LOG(VB_MEDIA, LOG_DEBUG, "Disc is unmountable?"); |
436 | 447 | if (OpenedHere) |
437 | 448 | closeDevice(); |
… |
… |
MythMediaStatus MythCDROMLinux::checkMedia() |
537 | 548 | } |
538 | 549 | case CDS_AUDIO: |
539 | 550 | LOG(VB_MEDIA, LOG_DEBUG, "found an audio disk"); |
| 551 | // pretend we're NOTMOUNTED so setStatus emits a signal |
| 552 | m_Status = MEDIASTAT_NOTMOUNTED; |
540 | 553 | m_MediaType = MEDIATYPE_AUDIO; |
541 | 554 | return setStatus(MEDIASTAT_USEABLE, OpenedHere); |
542 | 555 | break; |
543 | 556 | case CDS_MIXED: |
544 | | m_MediaType = MEDIATYPE_MIXED; |
545 | 557 | LOG(VB_MEDIA, LOG_DEBUG, "found a mixed CD"); |
546 | 558 | // Note: Mixed mode CDs require an explixit mount call |
547 | 559 | // since we'll usually want the audio portion. |
548 | 560 | // 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; |
550 | 565 | return setStatus(MEDIASTAT_USEABLE, OpenedHere); |
551 | 566 | #else |
| 567 | m_MediaType = MEDIATYPE_MIXED; |
552 | 568 | mount(); |
553 | 569 | if (isMounted()) |
554 | 570 | { |