Ticket #1970: 1970-fix-pmt-change-bug.patch
File 1970-fix-pmt-change-bug.patch, 3.4 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/dvbrecorder.cpp
417 417 PIDInfoMap::iterator lp_it = _pid_infos.begin(); 418 418 for (;lp_it != _pid_infos.end(); ++lp_it) 419 419 { 420 if (lp_it != it && (*lp_it)->priority < 0)420 if (lp_it != it && (*lp_it)->priority < kFilterPriorityHigh) 421 421 { 422 422 (*lp_it)->Close(); 423 423 break; … … 439 439 } 440 440 else 441 441 { 442 VERBOSE(VB_RECORD, LOC + "No low priority PID filter available, " 443 "open will fail."); 442 VERBOSE(VB_RECORD, LOC_ERR + "Out of PID filters!"); 444 443 } 445 444 } 446 445 … … 469 468 return avail; 470 469 } 471 470 471 bool DVBRecorder::SetPIDFilterPriority(uint pid, int priority) 472 { 473 PIDInfoMap::iterator it = _pid_infos.find(pid); 474 bool exists = it != _pid_infos.end(); 475 476 if (exists) 477 (*it)->priority = priority; 478 479 return exists; 480 } 481 472 482 bool DVBRecorder::AdjustFilters(void) 473 483 { 474 484 StopDummyVideo(); // Stop the dummy video before acquiring the lock. … … 519 529 _stream_data->AddListeningPID(pmt_pid); 520 530 if (pmt_pid == input_pmt_pid) 521 531 { 522 add_pid.push_back( input_pmt_pid);532 add_pid.push_back(pmt_pid); 523 533 add_stream_type.push_back(StreamID::PrivSec); 524 534 } 525 535 else … … 529 539 } 530 540 531 541 // Delete filters for pids we no longer wish to monitor 542 // and make sure pids are set to the correct priority 532 543 PIDInfoMap::iterator it = _pid_infos.begin(); 533 544 PIDInfoMap::iterator next = it; 534 545 for (; it != _pid_infos.end(); it = next) 535 546 { 536 547 next = it; next++; 537 548 538 if (find(add_pid.begin(), add_pid.end(), it.key()) == add_pid.end())549 if (find(add_pid.begin(), add_pid.end(), it.key()) != add_pid.end()) 539 550 { 540 _stream_data->RemoveListeningPID(it.key()); 541 _stream_data->RemoveWritingPID(it.key()); 542 (*it)->Close(); 543 delete *it; 544 _pid_infos.erase(it); 551 // Make sure this is considered high priority pid 552 SetPIDFilterPriority(it.key(), kFilterPriorityHigh); 553 continue; 545 554 } 555 556 if (find(_pmt_monitoring_pids.begin(), _pmt_monitoring_pids.end(), 557 it.key()) != _pmt_monitoring_pids.end()) 558 { 559 // Make sure this is considered low priority pid 560 SetPIDFilterPriority(it.key(), kFilterPriorityLow); 561 continue; 562 } 563 564 // Delete pids we are no longer interested in 565 _stream_data->RemoveListeningPID(it.key()); 566 _stream_data->RemoveWritingPID(it.key()); 567 (*it)->Close(); 568 delete *it; 569 _pid_infos.erase(it); 546 570 } 547 571 548 572 // Add or adjust filters for pids we wish to monitor -
libs/libmythtv/dvbrecorder.h
99 99 bool OpenFilter(uint pid, int pes_type, 100 100 uint mpeg_stream_type, int priority); 101 101 int OpenFilterFd(uint pid, int pes_type, uint stream_type); 102 bool SetPIDFilterPriority(uint pid, int priority); 102 103 103 104 void SetOutputPAT(ProgramAssociationTable*); 104 105 void SetOutputPMT(ProgramMapTable*);