Ticket #6032: redux.diff
File redux.diff, 5.2 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); 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 rec Height;1086 int recWidth; 1087 1087 1088 1088 if (recorder && HasFlags(kFlagRecorderRunning)) 1089 1089 { … … 1092 1092 filelen = (int)((float)GetFramesWritten() / GetFramerate()); 1093 1093 1094 1094 // Get the height and set the videoprops 1095 rec Height = curRecording->GetHeight();1096 curRecording->SetVidpropHeight(rec Height);1095 recWidth = curRecording->GetWidth(); 1096 curRecording->SetVidpropHeight(recWidth); 1097 1097 1098 1098 QString message = QString("DONE_RECORDING %1 %2") 1099 1099 .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) 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 (width > 1300) 3102 3136 { 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; 3105 3139 3106 query.bindValue(":VALUE", " 720");3140 query.bindValue(":VALUE", "1080"); 3107 3141 query.bindValue(":CHANID", chanid); 3108 3142 query.bindValue(":STARTTIME", startts); 3109 3143 3110 3144 query.exec(); 3111 3145 if (!query.isActive()) 3112 3146 MythDB::DBError("UpdateRes", query); 3147 } 3113 3148 3114 } 3115 else if (height > 1000 && height < 1100) 3149 else if (width > 800) 3116 3150 { 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; 3119 3153 3120 query.bindValue(":VALUE", " 1080");3154 query.bindValue(":VALUE", "720"); 3121 3155 query.bindValue(":CHANID", chanid); 3122 3156 query.bindValue(":STARTTIME", startts); 3123 3157 3124 3158 query.exec(); 3125 3159 if (!query.isActive()) 3126 3160 MythDB::DBError("UpdateRes", query); 3161 3127 3162 } 3128 3163 else 3129 3164 { 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)); 3131 3166 return; 3132 3167 } 3133 3168 3134 m_video Height = height;3169 m_videoWidth = width; 3135 3170 } 3136 3171 3137 3172