Ticket #6032: getwidthtoo.diff
File getwidthtoo.diff, 4.6 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/programinfo.h
321 321 322 322 // Resolution Set/Get 323 323 void SetResolution(uint width, uint height, long long frame); 324 int GetWidth(void); 324 325 int GetHeight(void); 325 void SetVidpropHeight(int height);326 void SetVidpropHeight(int width, int height); 326 327 327 328 // GUI stuff 328 329 void showDetails(void) const; … … 359 360 QString chanstr; 360 361 QString chansign; 361 362 QString channame; 363 uint m_videoWidth; 362 364 uint m_videoHeight; 363 365 364 366 int recpriority; -
libs/libmythtv/tv_rec.cpp
1083 1083 int filelen = -1; 1084 1084 pauseNotify = false; 1085 1085 ispip = false; 1086 int recWidth; 1086 1087 int recHeight; 1087 1088 1088 1089 if (recorder && HasFlags(kFlagRecorderRunning)) … … 1092 1093 filelen = (int)((float)GetFramesWritten() / GetFramerate()); 1093 1094 1094 1095 // Get the height and set the videoprops 1096 recWidth = curRecording->GetWidth(); 1095 1097 recHeight = curRecording->GetHeight(); 1096 curRecording->SetVidpropHeight(rec Height);1098 curRecording->SetVidpropHeight(recWidth, recHeight); 1097 1099 1098 1100 QString message = QString("DONE_RECORDING %1 %2") 1099 1101 .arg(cardid).arg(filelen); -
libs/libmythtv/programinfo.cpp
160 160 161 161 record = NULL; 162 162 163 m_videoWidth = 0; 163 164 m_videoHeight = 0; 164 165 } 165 166 … … 265 266 lastInUseTime = other.lastInUseTime; 266 267 record = NULL; 267 268 269 m_videoWidth = other.m_videoWidth; 268 270 m_videoHeight = other.m_videoHeight; 269 271 270 272 positionMapDBReplacement = other.positionMapDBReplacement; … … 3087 3089 return m_videoHeight; 3088 3090 } 3089 3091 3092 /** \fn ProgramInfo::GetWidth(void) 3093 * \brief Gets overall average width. 3094 */ 3095 int 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 3090 3124 /** \fn ProgramInfo::SetVidpropHeight(int height) 3091 3125 * \brief Sets overall average height flag in videoprops. 3092 3126 */ 3093 void ProgramInfo::SetVidpropHeight(int height)3127 void ProgramInfo::SetVidpropHeight(int width, int height) 3094 3128 { 3095 3129 MSqlQuery query(MSqlQuery::InitCon()); 3096 3130 … … 3098 3132 " CONCAT_WS(',', IF(videoprop = '', NULL, videoprop), :VALUE)" 3099 3133 " WHERE chanid = :CHANID AND starttime = :STARTTIME;"); 3100 3134 3101 if (height > 700 && height < 800 )3135 if (height > 700 && height < 800 && width < 1400) 3102 3136 { 3103 VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because height was %1").arg(height)); 3137 VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because width was %1 " 3138 "and height was %2").arg(width).arg(height)); 3104 3139 videoproperties |= VID_720; 3105 3140 3106 3141 query.bindValue(":VALUE", "720"); … … 3112 3147 MythDB::DBError("UpdateRes", query); 3113 3148 3114 3149 } 3115 else if (height > 1000 && height < 1100 )3150 else if (height > 1000 && height < 1100 || width >= 1400) 3116 3151 { 3117 VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because height was %1").arg(height)); 3152 VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because width was %1 " 3153 "and height was %2").arg(width).arg(height)); 3118 3154 videoproperties |= VID_1080; 3119 3155 3120 3156 query.bindValue(":VALUE", "1080");