Ticket #5932: ResolutionInDB.2.diff
File ResolutionInDB.2.diff, 4.7 KB (added by , 15 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/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 … … 469 482 _start_code = 0xffffffff; 470 483 } 471 484 485 uint height = 0; 486 uint width = 0; 487 472 488 bool hasFrame = false; 473 489 bool hasKeyFrame = false; 474 490 … … 551 567 hasFrame = true; 552 568 _seen_sps |= hasKeyFrame; 553 569 } 570 width = m_h264_parser.pictureWidth(); 571 height = m_h264_parser.pictureHeight(); 554 572 } 555 573 } // for (; i < TSPacket::SIZE; i++) 556 574 … … 567 585 _frames_written_count++; 568 586 } 569 587 588 if ((height > 0) && (height != m_videoHeight)) 589 { 590 m_videoHeight = height; 591 ResolutionChange(width, height); 592 } 593 570 594 return hasKeyFrame || (_payload_buffer.size() >= (188*50)); 571 595 } 572 596 -
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 */