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)
124 ret =
avio_read(pb, header + LXF_IDENT_LENGTH, 8);
128 version = bytestream_get_le32(&p);
129 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))
150 p += version ? 20 : 12;
157 ret = bytestream_get_le32(&p);
160 (int64_t)(uint32_t)
AV_RL32(p + 12));
171 audio_format = bytestream_get_le32(&p);
172 channels = bytestream_get_le32(&p);
173 track_size = bytestream_get_le32(&p);
193 "only 16-, 20-, 24- and 32-bit PCM currently supported\n");
207 "video doesn't seem to be PAL or NTSC. guessing PAL\n");
213 ret = av_popcount(channels) * track_size;
217 tmp = bytestream_get_le32(&p);
218 ret = bytestream_get_le32(&p);
234 uint32_t video_params, disk_params;
235 uint16_t record_date, expiration_date;
253 video_params =
AV_RL32(&header_data[40]);
254 record_date =
AV_RL16(&header_data[56]);
255 expiration_date =
AV_RL16(&header_data[58]);
256 disk_params =
AV_RL32(&header_data[116]);
259 st->
codec->
bit_rate = 1000000 * ((video_params >> 14) & 0xFF);
265 record_date, 1900 + (record_date & 0x7F), (record_date >> 7) & 0xF,
266 (record_date >> 11) & 0x1F);
269 expiration_date, 1900 + (expiration_date & 0x7F), (expiration_date >> 7) & 0xF,
270 (expiration_date >> 11) & 0x1F);
272 if ((video_params >> 22) & 1)
275 if ((lxf->
channels = 1 << (disk_params >> 4 & 3) + 1)) {