26 #define PVA_MAX_PAYLOAD_LENGTH 0x17f8
27 #define PVA_VIDEO_PAYLOAD 0x01
28 #define PVA_AUDIO_PAYLOAD 0x02
29 #define PVA_MAGIC (('A' << 8) + 'V')
44 const unsigned char *buf = pd->
buf;
80 #define pva_log if (read_packet) av_log
86 int syncword, streamid, reserved,
flags, length, pts_flag;
99 pts_flag = flags & 0x10;
109 if (reserved != 0x55) {
126 int pes_signal, pes_header_data_length, pes_packet_length,
128 unsigned char pes_header_data[256];
134 pes_header_data_length =
avio_r8(pb);
136 if (pes_signal != 1) {
138 "trying to recover\n");
145 avio_read(pb, pes_header_data, pes_header_data_length);
146 length -= 9 + pes_header_data_length;
148 pes_packet_length -= 3 + pes_header_data_length;
152 if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20)
176 int ret, length, streamid;
189 int64_t *pos, int64_t pos_limit) {
192 int length, streamid;
197 while (*pos < pos_limit) {