29 #define LXF_MAX_PACKET_HEADER_SIZE 256
30 #define LXF_HEADER_DATA_SIZE 120
31 #define LXF_IDENT "LEITCH\0"
32 #define LXF_IDENT_LENGTH 8
33 #define LXF_SAMPLERATE 48000
74 for (x = 0; x <
size; x += 4)
116 int track_size, samples,
ret;
117 uint32_t
version, audio_format, header_size, channels, tmp;
123 if ((ret =
sync(s, header)) < 0)
126 ret =
avio_read(pb, header + LXF_IDENT_LENGTH, 8);
130 version = bytestream_get_le32(&p);
131 header_size = bytestream_get_le32(&p);
135 if (header_size < (version ? 72 : 60) ||
143 if ((ret =
avio_read(pb, header + (p - header),
144 header_size - (p - header))) !=
145 header_size - (p - header))
152 p += version ? 20 : 12;
159 ret = bytestream_get_le32(&p);
162 (int64_t)(uint32_t)
AV_RL32(p + 12));
173 audio_format = bytestream_get_le32(&p);
174 channels = bytestream_get_le32(&p);
175 track_size = bytestream_get_le32(&p);
195 "only 16-, 20-, 24- and 32-bit PCM currently supported\n");
209 "video doesn't seem to be PAL or NTSC. guessing PAL\n");
215 ret = av_popcount(channels) * track_size;
219 tmp = bytestream_get_le32(&p);
220 ret = bytestream_get_le32(&p);
236 uint32_t video_params, disk_params;
237 uint16_t record_date, expiration_date;
255 video_params =
AV_RL32(&header_data[40]);
256 record_date =
AV_RL16(&header_data[56]);
257 expiration_date =
AV_RL16(&header_data[58]);
258 disk_params =
AV_RL32(&header_data[116]);
261 st->
codec->
bit_rate = 1000000 * ((video_params >> 14) & 0xFF);
267 record_date, 1900 + (record_date & 0x7F), (record_date >> 7) & 0xF,
268 (record_date >> 11) & 0x1F);
271 expiration_date, 1900 + (expiration_date & 0x7F), (expiration_date >> 7) & 0xF,
272 (expiration_date >> 11) & 0x1F);
274 if ((video_params >> 22) & 1)
277 if ((lxf->
channels = 1 << (disk_params >> 4 & 3) + 1)) {
307 "got packet with illegal stream index %"PRIu32
"\n", stream);