- if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) {
- /* for subtitle, a single PES packet must be generated */
- mpegts_write_pes(s, st, buf, size, pts, AV_NOPTS_VALUE);
- return 0;
- }
-
- if (st->codec->codec_id == CODEC_ID_DIRAC) {
- /* for Dirac, a single PES packet must be generated */
- mpegts_write_pes(s, st, buf, size, pts, dts);
- return 0;
- }
-
- if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO ||
- st->codec->codec_id == CODEC_ID_MPEG1VIDEO) {
- const uint8_t *p = pkt->data;
- const uint8_t *end = pkt->data+pkt->size;
- uint32_t state = -1;
- while (p < end) {
- p = ff_find_start_code(p, end, &state);
- if (state == PICTURE_START_CODE) {
- access_unit_index = p - 4;
- break;
- }
- }
- } if (st->codec->codec_id == CODEC_ID_H264) {