Ticket #5932: ResolutionInDB.diff
File ResolutionInDB.diff, 4.9 KB (added by , 12 years ago) |
---|
-
libs/libmythtv/recorderbase.cpp
240 240 241 241 if (rb_changed) 242 242 m_videoAspect = 0; 243 m_videoWidth = 0; 244 m_videoHeight = 0; 243 245 } 244 246 245 247 /** \fn RecorderBase::SavePositionMap(bool) … … 302 304 curRecording->SetAspectChange(mark, frame); 303 305 } 304 306 307 void RecorderBase::ResolutionChange(uint width,uint height) 308 { 309 if (curRecording) 310 curRecording->SetResolution(width, height); 311 } 312 313 305 314 /* vim: set expandtab tabstop=4 shiftwidth=4: */ -
libs/libmythtv/dbcheck.cpp
18 18 #define MINIMUM_DBMS_VERSION 5,0,15 19 19 20 20 /// This is the DB schema version expected by the running MythTV instance. 21 const QString currentDatabaseVersion = "122 3";21 const QString currentDatabaseVersion = "1224"; 22 22 23 23 static bool UpdateDBVersionNumber(const QString &newnumber); 24 24 static bool performActualUpdate( … … 4302 4302 return false; 4303 4303 } 4304 4304 4305 if (dbver == "1223") 4306 { 4307 const char *updates[] = { 4308 "ALTER TABLE `recorded` ADD `width` INT NOT NULL ,", 4309 "ADD `height` INT NOT NULL ;", 4310 NULL 4311 }; 4312 if (!performActualUpdate(updates, "1224", dbver)) 4313 return false; 4314 } 4315 4305 4316 return true; 4306 4317 } 4307 4318 -
libs/libmythtv/dtvrecorder.cpp
261 261 bool hasKeyFrame = false; 262 262 263 263 uint aspectRatio = 0; 264 uint height = 0; 265 uint width = 0; 264 266 265 267 // Scan for PES header codes; specifically picture_start 266 268 // sequence_start (SEQ) and group_start (GOP). … … 293 295 294 296 // Look for aspectRatio changes and store them in the database 295 297 aspectRatio = (bufptr[3] >> 4); 298 299 // Get resolution 300 height = ((bufptr[1] & 0xf) << 8) | bufptr[2]; 301 width = (bufptr[0] <<4) | (bufptr[1]>>4); 302 296 303 //int frameRate = (bufptr[3] & 0x0000000f); 297 304 } 298 305 } … … 328 335 AspectChange((AspectRatio)aspectRatio, _frames_written_count); 329 336 } 330 337 338 if ((height > 0) && (height != m_videoHeight)) 339 { 340 m_videoHeight = height; 341 ResolutionChange(width, height); 342 } 343 331 344 return hasKeyFrame || (_payload_buffer.size() >= (188*50)); 332 345 } 333 346 -
libs/libmythtv/recorderbase.h
243 243 */ 244 244 void AspectChange(AspectRatio ratio, long long frame); 245 245 246 void ResolutionChange(uint width, uint height); 247 246 248 TVRec *tvrec; 247 249 RingBuffer *ringBuffer; 248 250 bool weMadeBuffer; … … 259 261 260 262 uint m_videoAspect; // AspectRatio 261 263 264 uint m_videoHeight; 265 uint m_videoWidth; 266 262 267 ProgramInfo *curRecording; 263 268 264 269 // For handling pausing -
libs/libmythtv/programinfo.h
314 314 // Aspect Ratio map 315 315 void SetAspectChange(MarkTypes type, long long frame); 316 316 317 // Resolution Set 318 void SetResolution(uint width, uint height); 319 317 320 // GUI stuff 318 321 void showDetails(void) const; 319 322 void EditRecording(void); -
libs/libmythtv/programinfo.cpp
2972 2972 MythDB::DBError("aspect ratio change insert", query); 2973 2973 } 2974 2974 2975 /** \fn ProgramInfo::SetResolution(uint width, uint height) 2976 * \brief Store the Resolution in the recorded table 2977 */ 2978 void ProgramInfo::SetResolution(uint width, uint height) 2979 { 2980 if (isVideo) 2981 return; 2982 2983 MSqlQuery query(MSqlQuery::InitCon()); 2984 2985 query.prepare("UPDATE recorded SET" 2986 " width = :WIDTH," 2987 " height = :HEIGHT WHERE" 2988 " chanid = :CHANID AND" 2989 " starttime = :STARTTIME;"); 2990 query.bindValue(":CHANID", chanid); 2991 query.bindValue(":STARTTIME", recstartts); 2992 2993 query.bindValue(":WIDTH", width); 2994 query.bindValue(":HEIGHT", height); 2995 2996 if (!query.exec() || !query.isActive()) 2997 MythDB::DBError("Resolution insert", query); 2998 } 2999 2975 3000 /** \fn ProgramInfo::ReactivateRecording(void) 2976 3001 * \brief Asks the scheduler to restart this recording if possible. 2977 3002 */