diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-27 14:29:36 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-27 14:31:15 +0400 |
commit | e82071e7279ab8d8ec138753822222a6cff26f35 (patch) | |
tree | 7839a057f4d26a05ee6ddd080719263a22fe81c4 /libavformat/lxfdec.c | |
parent | 72eddc10fa1f3ca7fb95292673fa26401f754c92 (diff) | |
parent | 839df90c718dcab9b9e91ca3c7e73479b3e8103c (diff) |
Merge commit '839df90c718dcab9b9e91ca3c7e73479b3e8103c'
* commit '839df90c718dcab9b9e91ca3c7e73479b3e8103c':
lxf: Support 16-channel files
lxf: Support version 1 files
Conflicts:
libavformat/lxfdec.c
See: e701b0cf7553202085840d3bfd1aff432b4de513
See: 1a06d6dd866318b49596c0bf5ed03917f952d3bd
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/lxfdec.c')
-rw-r--r-- | libavformat/lxfdec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c index c854216215..aa31738e0c 100644 --- a/libavformat/lxfdec.c +++ b/libavformat/lxfdec.c @@ -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); |