Ticket #12767: myth_29_patches.patch

File myth_29_patches.patch, 5.5 KB (added by Steve LeBlanc <sj.leblanc@…>, 3 years ago)

mythtv 29 patches for upnp operation

  • mythtv/libs/libmythupnp/upnpcds.cpp

    diff --git a/mythtv/libs/libmythupnp/upnpcds.cpp b/mythtv/libs/libmythupnp/upnpcds.cpp
    index cc86e75..213dd9b 100644
    a b QString UPnpCDSExtension::CreateIDString(const QString &requestId, 
    10691069
    10701070    // For metadata requests the request ID will be the ID of the result, so
    10711071    // we don't need to do anything
    1072     if (currentName == name.toLower() && !currentValue.isEmpty() &&
    1073         currentValue == value.toLower())
     1072    if (currentName.toLower() == name.toLower() && !currentValue.isEmpty() &&
     1073        currentValue.toLower() == value.toLower())
    10741074        return requestId;
    10751075    else if (currentName == name.toLower() && currentValue.isEmpty())
    10761076        return QString("%1=%2").arg(requestId).arg(value);
  • mythtv/libs/libmythupnp/upnpcdsobjects.cpp

    diff --git a/mythtv/libs/libmythupnp/upnpcdsobjects.cpp b/mythtv/libs/libmythupnp/upnpcdsobjects.cpp
    index 11df343..4400f4d 100644
    a b void CDSObject::toXml( QTextStream &os, FilterMap &filter, 
    305305     *      See UPnP MediaServer, ContentDirectory Service Section 2.3.18, 2013
    306306     */
    307307    bool    bFilter = true;
     308    QString sTitle = m_sTitle;
    308309
    309310    if (filter.contains("*"))
    310311        bFilter = false;
    void CDSObject::toXml( QTextStream &os, FilterMap &filter, 
    346347               << "\" >" << endl;
    347348
    348349            sEndTag = "</item>";
    349 
     350           
     351            // if this is a video item, we have filters, and no ProgramTitle filter is specified - ass the program title to sTitle
     352            if( bFilter && m_sClass == "object.item.videoItem" && !filter.contains("programTitle"))
     353               sTitle = m_sTitle + ":" + HTTPRequest::Encode(GetPropValue("programTitle"));
    350354            break;
    351355        }
    352356        default: break;
    353357    }
    354358
    355     os << "<dc:title>"   << m_sTitle << "</dc:title>" << endl;
     359    os << "<dc:title>"   <<  sTitle << "</dc:title>" << endl;
    356360    os << "<upnp:class>" << m_sClass << "</upnp:class>" << endl;
    357361
    358362    // ----------------------------------------------------------------------
  • mythtv/libs/libmythupnp/upnpdevice.cpp

    diff --git a/mythtv/libs/libmythupnp/upnpdevice.cpp b/mythtv/libs/libmythupnp/upnpdevice.cpp
    index bb23de4..c5ff2b0 100644
    a b QString UPnpDeviceDesc::FormatValue(const NameValue& node) 
    543543    NameValues::iterator it;
    544544    for (it = node.pAttributes->begin(); it != node.pAttributes->end(); ++it)
    545545    {
    546         sAttributes += QString(" %1='%2'").arg((*it).sName).arg((*it).sValue);
     546        sAttributes += QString(" %1=\"%2\"").arg((*it).sName).arg((*it).sValue);
    547547    }
    548548    sStr = QString("<%1%2>%3</%1>\n").arg(node.sName).arg(sAttributes).arg(node.sValue);
    549549
  • mythtv/libs/libmythupnp/upnphelpers.cpp

    diff --git a/mythtv/libs/libmythupnp/upnphelpers.cpp b/mythtv/libs/libmythupnp/upnphelpers.cpp
    index 2865e15..3f8a4b9 100644
    a b QString DLNAProfileName(const QString &mimeType, const QSize &resolution, 
    120120    // information in the database for each file and can determine this
    121121    // stuff 'properly'
    122122    QString sCountryCode = gCoreContext->GetLocale()->GetCountryCode();
    123     bool isNorthAmerica = (sCountryCode == "us" || sCountryCode == "ca" ||
     123    bool isNorthAmerica = (sCountryCode.toLower() == "us" || sCountryCode == "ca" ||
    124124                            sCountryCode == "mx"); // North America (NTSC/ATSC)
    125125
    126126    if (container == "MPEG2-PS")
    QString DLNAProfileName(const QString &mimeType, const QSize &resolution, 
    199199    }
    200200    else if (mimeType == "audio/mpeg")
    201201    {
    202         sProfileName = "MP3X";
     202        sProfileName = "MP3";
    203203    }
    204204    else if (mimeType == "audio/x-ms-wma")
    205205    {
    QString DLNAFourthField(UPNPProtocol::TransferProtocol protocol, 
    261261    //
    262262    QString sProfileName = DLNAProfileName(mimeType, resolution, videoFrameRate,
    263263                                           container, videoCodec, audioCodec);
    264     if (!sProfileName.isEmpty())
    265         sAdditionalInfoList << QString("DLNA.ORG_PN=%1").arg(sProfileName);
    266 
     264    //Do not output DLNA Profile name - possible to add a DB parameter to enable/disable?
     265    //if (!sProfileName.isEmpty())
     266    //    sAdditionalInfoList << QString("DLNA.ORG_PN=%1").arg(sProfileName);
    267267    //
    268268    // OP-Param (Operation Parameters)
    269269    //
  • mythtv/programs/mythbackend/upnpcdstv.cpp

    diff --git a/mythtv/programs/mythbackend/upnpcdstv.cpp b/mythtv/programs/mythbackend/upnpcdstv.cpp
    index 3fbc3e2..3c808f8 100644
    a b bool UPnpCDSTv::LoadTitles(const UPnpCDSRequest* pRequest, 
    563563        int nRecordingID = query.value(2).toInt();
    564564        int nTitleCount = query.value(3).toInt();
    565565
    566          if (nTitleCount > 1)
     566         if (nTitleCount >= 1)
    567567         {
    568568            // TODO Album or plain old container?
    569569            CDSObject* pContainer = CDSObject::CreateAlbum( CreateIDString(sRequestId, "Title", sTitle),
    bool UPnpCDSTv::LoadDates(const UPnpCDSRequest* pRequest, 
    624624    MSqlQuery query(MSqlQuery::InitCon(MSqlQuery::kDedicatedConnection));
    625625
    626626    QString sql = "SELECT SQL_CALC_FOUND_ROWS "
    627                   "r.starttime, COUNT(r.recordedid) "
     627                  "CONVERT_TZ(r.starttime, 'UTC', 'SYSTEM'), COUNT(r.recordedid) "
    628628                  "FROM recorded r "
    629629                  "LEFT JOIN recgroups g ON g.recgroup=r.recgroup "
    630630                  "%1 " // WHERE clauses