Ticket #12640: cdio_paranoia.patch

File cdio_paranoia.patch, 9.1 KB (added by mail@…, 3 years ago)

Patch fix

  • mythplugins/configure

    diff -ruN mythtv-0.28/mythplugins/configure mythtv-0.28_new/mythplugins/configure
    old new  
    682682        echo "MythMusic requires FLAC."
    683683    fi
    684684
    685     if ! check_lib cdio/cdio.h cdio_open -lcdio || ! check_lib cdio/cdda.h cdio_cddap_open -lcdio_cdda || ! check_lib cdio/paranoia.h cdio_paranoia_init -lcdio_paranoia ; then
     685    if ! check_lib cdio/cdio.h cdio_open -lcdio || (! check_lib cdio/cdda.h cdio_cddap_open -lcdio_cdda && ! check_lib cdio/paranoia/cdda.h cdio_cddap_open -lcdio_cdda) || (! check_lib cdio/paranoia.h cdio_paranoia_init -lcdio_paranoia && ! check_lib cdio/paranoia/paranoia.h cdio_paranoia_init -lcdio_paranoia) ; then
    686686        disable cdio
    687687    fi
    688688
     
    901901    fi
    902902
    903903    if enabled cdio ; then
    904       echo "#define HAVE_CDIO 1" >> ./mythmusic/mythmusic/config.h
     904      if check_lib cdio/cdda.h cdio_cddap_open -lcdio_cdda ; then
     905        echo "#define HAVE_CDIO 1" >> ./mythmusic/mythmusic/config.h
     906      else
     907        echo "#define HAVE_CDIO_PARANOIA 1" >> ./mythmusic/mythmusic/config.h
     908      fi
    905909      echo "CONFIG += cdio" >> ./mythmusic/mythmusic/config.pro
    906910      echo "        libcdio        support will be included in MythMusic"
    907911    else
    908912      echo "#undef  HAVE_CDIO" >> ./mythmusic/mythmusic/config.h
     913      echo "#undef  HAVE_CDIO_PARANOIA" >> ./mythmusic/mythmusic/config.h
    909914      echo "        libcdio        support will not be included in MythMusic"
    910915    fi
    911916
  • mythplugins/mythmusic/mythmusic/cddecoder.cpp

    diff -ruN mythtv-0.28/mythplugins/mythmusic/mythmusic/cddecoder.cpp mythtv-0.28_new/mythplugins/mythmusic/mythmusic/cddecoder.cpp
    old new  
    1414#include <QString>
    1515
    1616// libcdio
    17 #include <cdio/cdda.h>
     17#ifdef HAVE_CDIO
     18# include <cdio/cdda.h>
     19#else
     20# include <cdio/paranoia/cdda.h>
     21#endif
    1822#include <cdio/logging.h>
    1923
    2024// MythTV
  • mythplugins/mythmusic/mythmusic/cddecoder.h

    diff -ruN mythtv-0.28/mythplugins/mythmusic/mythmusic/cddecoder.h mythtv-0.28_new/mythplugins/mythmusic/mythmusic/cddecoder.h
    old new  
    1515# include <cdio/paranoia.h>
    1616#endif
    1717
     18#ifdef HAVE_CDIO_PARANOIA
     19# include <cdio/paranoia/cdda.h>
     20# include <cdio/paranoia/paranoia.h>
     21#endif
     22
    1823class MusicMetadata;
    1924
    2025class CdDecoder : public Decoder
     
    8287    int m_settracknum;
    8388    int m_tracknum;
    8489
    85 #ifdef HAVE_CDIO
     90#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    8691    CdIo_t *m_cdio;
    8792    cdrom_drive_t *m_device;
    8893    cdrom_paranoia_t *m_paranoia;
  • mythplugins/mythmusic/mythmusic/cdrip.cpp

    diff -ruN mythtv-0.28/mythplugins/mythmusic/mythmusic/cdrip.cpp mythtv-0.28_new/mythplugins/mythmusic/mythmusic/cdrip.cpp
    old new  
    1212# include <cdio/paranoia.h>
    1313#endif //def HAVE_CDIO
    1414
     15#ifdef HAVE_CDIO_PARANOIA
     16# include <cdio/paranoia/cdda.h>
     17# include <cdio/paranoia/paranoia.h>
     18#endif //def HAVE_CDIO_PARANOIA
     19
    1520// C++ includes
    1621#include <iostream>
    1722#include <memory>
     
    5257
    5358// MythMusic includes
    5459#include "cdrip.h"
    55 #ifdef HAVE_CDIO
     60#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    5661#include "cddecoder.h"
    57 #endif // HAVE_CDIO
     62#endif // HAVE_CDIO || HAVE_CDIO_PARANOIA
    5863#include "encoder.h"
    5964#include "vorbisencoder.h"
    6065#include "lameencoder.h"
     
    6469#include "mythlogging.h"
    6570#include "musicutils.h"
    6671
    67 #ifdef HAVE_CDIO
     72#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    6873// libparanoia compatibility
    6974#ifndef cdrom_paranoia
    7075#define cdrom_paranoia cdrom_paranoia_t
     
    7378#ifndef CD_FRAMESIZE_RAW
    7479# define CD_FRAMESIZE_RAW CDIO_CD_FRAMESIZE_RAW
    7580#endif // CD_FRAMESIZE_RAW
    76 #endif // HAVE_CDIO
     81#endif // HAVE_CDIO || HAVE_CDIO_PARANOIA
    7782
    7883QEvent::Type RipStatusEvent::kTrackTextEvent =
    7984    (QEvent::Type) QEvent::registerEventType();
     
    132137
    133138static long int getSectorCount (QString &cddevice, int tracknum)
    134139{
    135 #ifdef HAVE_CDIO
     140#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    136141    QByteArray devname = cddevice.toLatin1();
    137142    cdrom_drive *device = cdda_identify(devname.constData(), 0, NULL);
    138143
     
    168173    cdda_close(device);
    169174#else
    170175    (void)cddevice; (void)tracknum;
    171 #endif // HAVE_CDIO
     176#endif // HAVE_CDIO || HAVE_CDIO_PARANOIA
    172177    return 0;
    173178}
    174179
    175 #ifdef HAVE_CDIO
     180#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    176181static void paranoia_cb(long, paranoia_cb_mode_t)
    177182{
    178183}
    179 #endif // HAVE_CDIO
     184#endif // HAVE_CDIO || HAVE_CDIO_PARANOIA
    180185
    181186CDRipperThread::CDRipperThread(RipStatus *parent,  QString device,
    182187                               QVector<RipTrack*> *tracks, int quality) :
     
    413418
    414419int CDRipperThread::ripTrack(QString &cddevice, Encoder *encoder, int tracknum)
    415420{
    416 #ifdef HAVE_CDIO
     421#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    417422    QByteArray devname = cddevice.toLatin1();
    418423    cdrom_drive *device = cdda_identify(devname.constData(), 0, NULL);
    419424
     
    529534#else
    530535    (void)cddevice; (void)encoder; (void)tracknum;
    531536    return 0;
    532 #endif // HAVE_CDIO
     537#endif // HAVE_CDIO || HAVE_CDIO_PARANOIA
    533538}
    534539
    535540///////////////////////////////////////////////////////////////////////////////
     
    873878
    874879void Ripper::scanCD(void)
    875880{
    876 #ifdef HAVE_CDIO
     881#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    877882    {
    878883    LOG(VB_MEDIA, LOG_INFO, QString("Ripper::%1 CD='%2'").
    879884        arg(__func__).arg(m_CDdevice));
    880885    (void)cdio_close_tray(m_CDdevice.toLatin1().constData(), NULL);
    881886    }
    882 #endif // HAVE_CDIO
     887#endif // HAVE_CDIO || HAVE_CDIO_PARANOIA
    883888
    884889    if (m_decoder)
    885890        delete m_decoder;
     
    12261231    bool bEjectCD = gCoreContext->GetNumSetting("EjectCDAfterRipping",1);
    12271232    if (bEjectCD)
    12281233    {
    1229 #ifdef HAVE_CDIO
     1234#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    12301235        LOG(VB_MEDIA, LOG_INFO, QString("Ripper::%1 '%2'").
    12311236            arg(__func__).arg(m_CDdevice));
    12321237        (void)cdio_eject_media_drive(m_CDdevice.toLatin1().constData());
     
    12421247                mon->Unlock(pMedia);
    12431248            }
    12441249        }
    1245 #endif // HAVE_CDIO
     1250#endif // HAVE_CDIO || HAVE_CDIO_PARANOIA
    12461251    }
    12471252}
    12481253
  • mythplugins/mythmusic/mythmusic/decoder.cpp

    diff -ruN mythtv-0.28/mythplugins/mythmusic/mythmusic/decoder.cpp mythtv-0.28_new/mythplugins/mythmusic/mythmusic/decoder.cpp
    old new  
    7171    {
    7272        factories = new QList<DecoderFactory*>;
    7373
    74 #ifdef HAVE_CDIO
     74#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    7575        Decoder::registerFactory(new CdDecoderFactory);
    7676#endif
    7777        Decoder::registerFactory(new avfDecoderFactory);
  • mythplugins/mythmusic/mythmusic/main.cpp

    diff -ruN mythtv-0.28/mythplugins/mythmusic/mythmusic/main.cpp mythtv-0.28_new/mythplugins/mythmusic/mythmusic/main.cpp
    old new  
    4747#include "importmusic.h"
    4848#include "metaio.h"
    4949
    50 #ifdef HAVE_CDIO
     50#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    5151#include "cdrip.h"
    5252#endif
    5353
    54 #if defined HAVE_CDIO
     54#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    5555/**
    5656 * \brief Work out the best CD drive to use at this time
    5757 */
     
    197197
    198198static void startRipper(void)
    199199{
    200 #if defined HAVE_CDIO
     200#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    201201    if (!checkStorageGroup())
    202202        return;
    203203
     
    418418{
    419419    gMusicData->loadMusic();
    420420
    421 #if defined HAVE_CDIO
     421#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    422422    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    423423
    424424    Ripper *rip = new Ripper(mainStack, chooseCD());
     
    638638    }
    639639}
    640640
    641 #ifdef HAVE_CDIO
     641#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    642642static void handleCDMedia(MythMediaDevice *cd)
    643643{
    644644
  • mythplugins/mythmusic/mythmusic/musicplayer.cpp

    diff -ruN mythtv-0.28/mythplugins/mythmusic/mythmusic/musicplayer.cpp mythtv-0.28_new/mythplugins/mythmusic/mythmusic/musicplayer.cpp
    old new  
    2424#include "decoder.h"
    2525#include "decoderhandler.h"
    2626#include "metaio.h"
    27 #ifdef HAVE_CDIO
     27#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    2828#include "cddecoder.h"
    2929#endif
    3030#include "constants.h"
     
    15481548    LOG(VB_PLAYBACK, LOG_INFO, QString ("decoder handler is ready, decoding %1")
    15491549            .arg(getDecoder()->getURL()));
    15501550
    1551 #ifdef HAVE_CDIO
     1551#if defined HAVE_CDIO || defined HAVE_CDIO_PARANOIA
    15521552    CdDecoder *cddecoder = dynamic_cast<CdDecoder*>(getDecoder());
    15531553    if (cddecoder)
    15541554        cddecoder->setDevice(gCDdevice);