| 345 | } |
| 346 | |
| 347 | void TsPacket::AddPadding(size_t num_stuffings) { |
| 348 | const bool no_af_before = (_adaptation_field == NULL); |
| 349 | TsAdaptationField* af = mutable_adaptation_field(); |
| 350 | if (no_af_before) { |
| 351 | const size_t sz = af->ByteSize(); |
| 352 | if (num_stuffings > sz) { |
| 353 | af->nb_af_reserved = num_stuffings - sz; |
| 354 | } |
| 355 | } else { |
| 356 | af->nb_af_reserved += num_stuffings; |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | void TsPacket::CreateAsPAT(int16_t pmt_number, TsPid pmt_pid) { |
| 361 | if (_modified) { |