Merge commit '839df90c718dcab9b9e91ca3c7e73479b3e8103c'

* commit '839df90c718dcab9b9e91ca3c7e73479b3e8103c':
  lxf: Support 16-channel files
  lxf: Support version 1 files

Conflicts:
	libavformat/lxfdec.c

See: e701b0cf75
See: 1a06d6dd86
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-27 12:29:36 +02:00
commit e82071e727
1 changed files with 6 additions and 6 deletions

View File

@ -115,7 +115,7 @@ static int get_packet_header(AVFormatContext *s)
uint32_t version, audio_format, header_size, channels, tmp;
AVStream *st;
uint8_t header[LXF_MAX_PACKET_HEADER_SIZE];
const uint8_t *p;
const uint8_t *p = header + LXF_IDENT_LENGTH;
//find and read the ident
if ((ret = sync(s, header)) < 0)
@ -125,11 +125,11 @@ static int get_packet_header(AVFormatContext *s)
if (ret != 8)
return ret < 0 ? ret : AVERROR_EOF;
p = header + LXF_IDENT_LENGTH;
version = bytestream_get_le32(&p);
header_size = bytestream_get_le32(&p);
if (version > 1)
avpriv_request_sample(s, "format version %i", version);
avpriv_request_sample(s, "Unknown format version %i\n", version);
if (header_size < (version ? 72 : 60) ||
header_size > LXF_MAX_PACKET_HEADER_SIZE ||
(header_size & 3)) {
@ -140,9 +140,8 @@ static int get_packet_header(AVFormatContext *s)
//read the rest of the packet header
if ((ret = avio_read(pb, header + (p - header),
header_size - (p - header))) !=
header_size - (p - header)) {
header_size - (p - header))
return ret < 0 ? ret : AVERROR_EOF;
}
if (check_checksum(header, header_size))
av_log(s, AV_LOG_ERROR, "checksum error\n");
@ -167,7 +166,8 @@ static int get_packet_header(AVFormatContext *s)
break;
}
if (version == 0) p += 8;
if (version == 0)
p += 8;
audio_format = bytestream_get_le32(&p);
channels = bytestream_get_le32(&p);
track_size = bytestream_get_le32(&p);