Ticket #9424: sony.diff
File sony.diff, 4.3 KB (added by , 13 years ago) |
---|
-
libs/libmythupnp/upnpcds.h
62 62 CDS_ClientXBMC = 2, // XBMC 63 63 CDS_ClientMP101 = 3, // Netgear MP101 64 64 CDS_ClientXBox = 4, // XBox 360 65 CDS_ClientSonyDB = 5, // Sony Blu-ray players 65 66 } UPnpCDSClient; 66 67 67 68 typedef struct 68 69 { 69 70 UPnpCDSClient nClientType; 71 QString sHeaderKey; 70 72 QString sClientId; 71 73 } UPnpCDSClientException; 72 74 -
libs/libmythupnp/upnpcds.cpp
190 190 191 191 static UPnpCDSClientException clientExceptions[] = { 192 192 // Windows Media Player version 12 193 { CDS_ClientWMP, " Windows-Media-Player" },193 { CDS_ClientWMP, "User-Agent","Windows-Media-Player" }, 194 194 // 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" }, 196 196 // XBMC 197 { CDS_ClientXBMC, " Platinum" },197 { CDS_ClientXBMC, "User-Agent","Platinum" }, 198 198 // 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\"" }, 200 202 }; 201 203 static uint clientExceptionCount = sizeof(clientExceptions) / 202 204 sizeof(clientExceptions[0]); … … 213 215 { 214 216 UPnpCDSClientException *except = &clientExceptions[i]; 215 217 216 int idx = sUserAgent.indexOf(except->sClientId); 218 QString sHeaderValue = pRequest->GetHeaderValue( except->sHeaderKey, "" ); 219 int idx = sHeaderValue.indexOf(except->sClientId); 217 220 if (idx != -1) 218 221 { 219 222 pCDSRequest->m_eClient = except->nClientType;; 223 224 idx += except->sClientId.length(); 220 225 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 221 233 // Now find the version number 222 234 QString version = 223 s UserAgent.mid( idx + except->sClientId.length() + 1).trimmed();235 sHeaderValue.mid( idx + except->sClientId.length() ).trimmed(); 224 236 idx = version.indexOf( '.' ); 225 237 if (idx != -1) 226 238 { -
programs/mythbackend/upnpcdstv.cpp
389 389 sMimeType = "video/x-ms-dvr"; 390 390 } 391 391 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 392 400 // DLNA string below is temp fix for ps3 seeking. 393 401 QString sProtocol = QString( "http-get:*:%1:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000" ).arg( sMimeType ); 394 402 QString sURI = QString( "%1GetRecording%2").arg( sURIBase ) -
programs/mythbackend/upnpcdsvideo.cpp
487 487 // ---------------------------------------------------------------------- 488 488 489 489 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 490 498 QString sProtocol = QString( "http-get:*:%1:DLNA.ORG_OP=01;DLNA.ORG_CI=0;" 491 499 "DLNA.ORG_FLAGS=0150000000000000000000000000" 492 500 "0000" ).arg( sMimeType );