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;
100 pts_flag = flags & 0x10;
110 if (reserved != 0x55) {
127 int pes_signal, pes_header_data_length, pes_packet_length,
129 unsigned char pes_header_data[256];
135 pes_header_data_length =
avio_r8(pb);
137 if (pes_signal != 1 || pes_header_data_length == 0) {
139 "trying to recover\n");
146 ret =
avio_read(pb, pes_header_data, pes_header_data_length);
147 if (ret != pes_header_data_length)
149 length -= 9 + pes_header_data_length;
151 pes_packet_length -= 3 + pes_header_data_length;
155 if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20) {
156 if (pes_header_data_length < 5) {
198 int64_t *pos, int64_t pos_limit) {
206 while (*pos < pos_limit) {