423 | | remainder = GetStreamData()->ProcessData(buffer, pktEnd); |
424 | | if (remainder > 0) |
425 | | { |
426 | | // only happens on fragmented packet reads |
427 | | VERBOSE(VB_CHANNEL, LOC + "RunTableMonitorSR(): " + |
428 | | QString("unhandled data (# bytes: %1)") |
429 | | .arg(remainder)); |
430 | | } |
| 423 | // Pass buffer in tspacket chunks to let AssemblePSIP reuild it |
| 424 | uint pos = 0; |
| 425 | buffer[3] = 0x10; // reset continuity ctr to 0 |
| 426 | while ( pos+188 <= pktEnd ) |
| 427 | { |
| 428 | remainder = GetStreamData()->ProcessData(&buffer[pos],188); |
| 429 | if ( remainder > 0 ) |
| 430 | { |
| 431 | VERBOSE(VB_CHANNEL, LOC + "RunTableMonitorSR(): " + |
| 432 | QString("unhandled data (# bytes: %1) pid %2 length %3") |
| 433 | .arg(remainder).arg(fit.key()).arg(len)); |
| 434 | break; |
| 435 | } |
| 436 | pos += 188-header_size; |
| 437 | buffer[3] = 0x10 | ((1+buffer[3])&0xf); // bump continuity ctr |
| 438 | memcpy(&buffer[pos], &buffer[0],5); // copy ts header upto data |
| 439 | } |
| 440 | |