27 #define LXF_MAX_PACKET_HEADER_SIZE 256
28 #define LXF_HEADER_DATA_SIZE 120
29 #define LXF_IDENT "LEITCH\0"
30 #define LXF_IDENT_LENGTH 8
31 #define LXF_SAMPLERATE 48000
72 for (x = 0; x <
size; x += 4)
114 int track_size, samples,
ret;
115 uint32_t
version, audio_format, header_size, channels, tmp;
121 if ((ret =
sync(s, header)) < 0)
129 version = bytestream_get_le32(&p);
130 header_size = bytestream_get_le32(&p);
133 if (header_size < (version ? 72 : 60) ||
141 if ((ret =
avio_read(pb, header + (p - header),
142 header_size - (p - header))) !=
143 header_size - (p - header)) {
151 p += version ? 20 : 12;
158 ret = bytestream_get_le32(&p);
161 (int64_t)(uint32_t)
AV_RL32(p + 12));
170 if (version == 0) p += 8;
171 audio_format = bytestream_get_le32(&p);
172 channels = bytestream_get_le32(&p);
173 track_size = bytestream_get_le32(&p);
191 "only 16-, 20-, 24- and 32-bit PCM currently supported\n");
205 "video doesn't seem to be PAL or NTSC. guessing PAL\n");
211 ret = av_popcount(channels) * track_size;
215 tmp = bytestream_get_le32(&p);
216 ret = bytestream_get_le32(&p);
232 uint32_t video_params, disk_params;
233 uint16_t record_date, expiration_date;
251 video_params =
AV_RL32(&header_data[40]);
252 record_date =
AV_RL16(&header_data[56]);
253 expiration_date =
AV_RL16(&header_data[58]);
254 disk_params =
AV_RL32(&header_data[116]);
257 st->
codec->
bit_rate = 1000000 * ((video_params >> 14) & 0xFF);
262 record_date, 1900 + (record_date & 0x7F), (record_date >> 7) & 0xF,
263 (record_date >> 11) & 0x1F);
266 expiration_date, 1900 + (expiration_date & 0x7F), (expiration_date >> 7) & 0xF,
267 (expiration_date >> 11) & 0x1F);
269 if ((video_params >> 22) & 1)
272 if ((lxf->
channels = 1 << (disk_params >> 4 & 3) + 1)) {
306 if (stream == 1 && !(ast = s->
streams[1])) {