| 402 | } |
| 403 | |
| 404 | bool Frontend::update() { |
| 405 | SI_LOG_INFO("Stream: %d, Updating frontend...", _streamID); |
| 406 | #ifndef SIMU |
| 407 | // Setup, tune and set PID Filters |
| 408 | if (_frontendData.hasDeviceDataChanged()) { |
| 409 | _frontendData.resetDeviceDataChanged(); |
| 410 | _tuned = false; |
| 411 | // Close active PIDs |
| 412 | for (std::size_t i = 0; i < mpegts::PidTable::MAX_PIDS; ++i) { |
| 413 | _frontendData.getFilterData().setPID(i, false); |
| 414 | closePid(i); |
| 415 | } |
| 416 | closeFE(); |
| 417 | closeDMX(); |
| 418 | // After close wait a moment before opening it again |
| 419 | std::this_thread::sleep_for(std::chrono::milliseconds(150)); |
| 420 | } |
| 421 | |
| 422 | if (!setupAndTune()) { |
| 423 | SI_LOG_INFO("Stream: %d, Updating frontend (Failed)", _streamID); |
| 424 | return false; |
| 425 | } |
| 426 | updatePIDFilters(); |
| 427 | #endif |
| 428 | SI_LOG_DEBUG("Stream: %d, Updating frontend (Finished)", _streamID); |
| 429 | return true; |
| 430 | } |
| 431 | |
| 432 | bool Frontend::teardown() { |
| 433 | // Close active PIDs |
nothing calls this directly
no test coverage detected