Ticket #6032: redux.diff

File redux.diff, 5.2 KB (added by robert.mcnamara@…, 15 years ago)

Makes requested changes.

  • libs/libmythtv/programinfo.h

     
    321321
    322322    // Resolution Set/Get
    323323    void SetResolution(uint width, uint height, long long frame);
     324    int GetWidth(void);
    324325    int GetHeight(void);
    325     void SetVidpropHeight(int height);
     326    void SetVidpropHeight(int width);
    326327
    327328    // GUI stuff
    328329    void showDetails(void) const;
     
    359360    QString chanstr;
    360361    QString chansign;
    361362    QString channame;
     363    uint m_videoWidth;
    362364    uint m_videoHeight;
    363365
    364366    int recpriority;
  • libs/libmythtv/tv_rec.cpp

     
    10831083    int filelen = -1;
    10841084    pauseNotify = false;
    10851085    ispip = false;
    1086     int recHeight;
     1086    int recWidth;
    10871087
    10881088    if (recorder && HasFlags(kFlagRecorderRunning))
    10891089    {
     
    10921092        filelen = (int)((float)GetFramesWritten() / GetFramerate());
    10931093
    10941094        // Get the height and set the videoprops
    1095         recHeight = curRecording->GetHeight();
    1096         curRecording->SetVidpropHeight(recHeight);
     1095        recWidth = curRecording->GetWidth();
     1096        curRecording->SetVidpropHeight(recWidth);
    10971097
    10981098        QString message = QString("DONE_RECORDING %1 %2")
    10991099            .arg(cardid).arg(filelen);
  • libs/libmythtv/programinfo.cpp

     
    160160
    161161    record = NULL;
    162162
     163    m_videoWidth = 0;
    163164    m_videoHeight = 0;
    164165}
    165166
     
    265266    lastInUseTime = other.lastInUseTime;
    266267    record = NULL;
    267268
     269    m_videoWidth = other.m_videoWidth;
    268270    m_videoHeight = other.m_videoHeight;
    269271
    270272    positionMapDBReplacement = other.positionMapDBReplacement;
     
    30873089    return m_videoHeight;
    30883090}
    30893091
     3092/** \fn ProgramInfo::GetWidth(void)
     3093 *  \brief Gets overall average width.
     3094 */
     3095int ProgramInfo::GetWidth(void)
     3096{
     3097    MSqlQuery query(MSqlQuery::InitCon());
     3098
     3099    query.prepare("SELECT recordedmarkup.DATA FROM recordedmarkup"
     3100                  " WHERE recordedmarkup.chanid = :CHANID"
     3101                  " AND recordedmarkup.starttime = :STARTTIME"
     3102                  " AND recordedmarkup.type = 30"
     3103                  " GROUP BY recordedmarkup.data ORDER BY"
     3104                  " SUM((SELECT IFNULL(rm.mark, recordedmarkup.mark)"
     3105                  " FROM recordedmarkup AS rm WHERE rm.chanid = recordedmarkup.chanid"
     3106                  " AND rm.starttime = recordedmarkup.starttime AND"
     3107                  " rm.type = recordedmarkup.type AND"
     3108                  " rm.mark > recordedmarkup.mark"
     3109                  " ORDER BY rm.mark ASC LIMIT 1)"
     3110                  " - recordedmarkup.mark) DESC LIMIT 1;");
     3111    query.bindValue(":CHANID", chanid);
     3112    query.bindValue(":STARTTIME", recstartts);
     3113
     3114    if (query.exec() && query.next())
     3115    {
     3116        m_videoWidth = query.value(0).toInt();
     3117    }
     3118    else
     3119        m_videoWidth = 0;
     3120
     3121    return m_videoWidth;
     3122}
     3123
    30903124/** \fn ProgramInfo::SetVidpropHeight(int height)
    30913125 *  \brief Sets overall average height flag in videoprops.
    30923126 */
    3093 void ProgramInfo::SetVidpropHeight(int height)
     3127void ProgramInfo::SetVidpropHeight(int width)
    30943128{
    30953129    MSqlQuery query(MSqlQuery::InitCon());
    30963130
     
    30983132    " CONCAT_WS(',', IF(videoprop = '', NULL, videoprop), :VALUE)"
    30993133    " WHERE chanid = :CHANID AND starttime = :STARTTIME;");
    31003134
    3101     if (height > 700 && height < 800)
     3135    if (width > 1300)
    31023136    {
    3103         VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because height was %1").arg(height));
    3104         videoproperties |= VID_720;
     3137        VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because width was %1").arg(width));
     3138        videoproperties |= VID_1080;
    31053139
    3106         query.bindValue(":VALUE", "720");
     3140        query.bindValue(":VALUE", "1080");
    31073141        query.bindValue(":CHANID", chanid);
    31083142        query.bindValue(":STARTTIME", startts);
    31093143
    31103144        query.exec();
    31113145        if (!query.isActive())
    31123146            MythDB::DBError("UpdateRes", query);
     3147    }
    31133148
    3114     }
    3115     else if (height > 1000 && height < 1100)
     3149    else if (width > 800)
    31163150    {
    3117         VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because height was %1").arg(height));
    3118         videoproperties |= VID_1080;
     3151        VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because width was %1").arg(width));
     3152        videoproperties |= VID_720;
    31193153
    3120         query.bindValue(":VALUE", "1080");
     3154        query.bindValue(":VALUE", "720");
    31213155        query.bindValue(":CHANID", chanid);
    31223156        query.bindValue(":STARTTIME", startts);
    31233157
    31243158        query.exec();
    31253159        if (!query.isActive())
    31263160            MythDB::DBError("UpdateRes", query);
     3161
    31273162    }
    31283163    else
    31293164    {
    3130         VERBOSE(VB_IMPORTANT, QString("Unknown type, recording height was %1").arg(height));
     3165        VERBOSE(VB_IMPORTANT, QString("Unknown type, recording width was %1").arg(width));
    31313166        return;
    31323167    }
    31333168
    3134     m_videoHeight = height;
     3169    m_videoWidth = width;
    31353170}
    31363171
    31373172