Ticket #9424: sony.3.diff

File sony.3.diff, 4.2 KB (added by mattpyne@…, 13 years ago)

In my haste I made a mistake in the patch...

  • libs/libmythupnp/upnpcds.h

     
    6262    CDS_ClientXBMC            = 2,      // XBMC
    6363    CDS_ClientMP101           = 3,      // Netgear MP101
    6464    CDS_ClientXBox            = 4,      // XBox 360
     65    CDS_ClientSonyDB          = 5,      // Sony Blu-ray players
    6566} UPnpCDSClient;
    6667
    6768typedef struct
    6869{
    6970    UPnpCDSClient   nClientType;
     71    QString         sHeaderKey;
    7072    QString         sClientId;
    7173} UPnpCDSClientException;
    7274
  • libs/libmythupnp/upnpcds.cpp

     
    190190
    191191static UPnpCDSClientException clientExceptions[] = {
    192192    // Windows Media Player version 12
    193     { CDS_ClientWMP,        "Windows-Media-Player" },
     193    { CDS_ClientWMP,        "User-Agent","Windows-Media-Player/" },
    194194    // Windows Media Player version < 12
    195     { CDS_ClientWMP,        "Mozilla/4.0 (compatible; UPnP/1.0; Windows 9x" },
     195    { CDS_ClientWMP,        "User-Agent","Mozilla/4.0 (compatible; UPnP/1.0; Windows 9x" },
    196196    // XBMC
    197     { CDS_ClientXBMC,       "Platinum" },
     197    { CDS_ClientXBMC,       "User-Agent","Platinum/" },
    198198    // XBox 360
    199     { CDS_ClientXBox,       "Xbox" },
     199    { CDS_ClientXBox,       "User-Agent","Xbox" },
     200    // Sony Blu-ray players
     201    { CDS_ClientSonyDB,     "X-AV-Client-Info","cn=\"Sony Corporation\"; mn=\"Blu-ray Disc Player\"" },
    200202};
    201203static uint clientExceptionCount = sizeof(clientExceptions) /
    202204                                   sizeof(clientExceptions[0]);
     
    213215    {
    214216        UPnpCDSClientException *except = &clientExceptions[i];
    215217
    216         int idx = sUserAgent.indexOf(except->sClientId);
     218        QString sHeaderValue = pRequest->GetHeaderValue( except->sHeaderKey, "" );
     219        int idx = sHeaderValue.indexOf(except->sClientId);
    217220        if (idx != -1)
    218221        {
    219222            pCDSRequest->m_eClient = except->nClientType;;
     223           
     224            idx += except->sClientId.length();
    220225
     226            // If we have a / at the end of the string then we
     227            // increment the string to skip over it
     228            if ( sHeaderValue[ idx ] == '/')
     229            {
     230                ++ idx;
     231            }
     232
    221233            // Now find the version number
    222234            QString version =
    223                sUserAgent.mid( idx + except->sClientId.length() + 1 ).trimmed();
     235               sHeaderValue.mid( idx ).trimmed();
    224236            idx = version.indexOf( '.' );
    225237            if (idx != -1)
    226238            {
  • programs/mythbackend/upnpcdstv.cpp

     
    389389        sMimeType = "video/x-ms-dvr";
    390390    }
    391391
     392    // If we are dealing with a Sony Blu-ray player then we fake the
     393    // MIME type to force the video to appear
     394    if ( pRequest->m_eClient == CDS_ClientSonyDB )
     395    {
     396        sMimeType = "video/avi";
     397    }
     398
     399
    392400    // DLNA string below is temp fix for ps3 seeking.
    393401    QString sProtocol = QString( "http-get:*:%1:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000" ).arg( sMimeType  );
    394402    QString sURI      = QString( "%1GetRecording%2").arg( sURIBase   )
  • programs/mythbackend/upnpcdsvideo.cpp

     
    487487    // ----------------------------------------------------------------------
    488488
    489489    QString sMimeType = HTTPRequest::GetMimeType( fInfo.suffix() );
     490
     491    // If we are dealing with a Sony Blu-ray player then we fake the
     492    // MIME type to force the video to appear
     493    if ( pRequest->m_eClient == CDS_ClientSonyDB )
     494    {   
     495        sMimeType = "video/avi";
     496    }
     497
    490498    QString sProtocol = QString( "http-get:*:%1:DLNA.ORG_OP=01;DLNA.ORG_CI=0;"
    491499                                 "DLNA.ORG_FLAGS=0150000000000000000000000000"
    492500                                 "0000" ).arg( sMimeType  );