diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-15 21:30:30 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-15 21:38:23 +0100 |
commit | cddd15ba5c9cd2e92d2f2942e0fc40bf3bf56115 (patch) | |
tree | b61ebf35cd95163d026ac7450a57d476d8f4ea3a /libavformat/matroskadec.c | |
parent | d03eea36b2c329241f63c8aca2d6adbb6ea81d9c (diff) | |
download | ffmpeg-cddd15ba5c9cd2e92d2f2942e0fc40bf3bf56115.tar.gz |
avformat/matroska: simplify signed int access code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 6bb75457cb..685f7837ed 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -773,11 +773,7 @@ static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num) if (size == 0) { *num = 0; } else { - *num = avio_r8(pb); - /* negative value */ - if (*num & 0x80) { - *num = (-1 << 8) | *num; - } + *num = sign_extend(avio_r8(pb), 8); /* big-endian ordering; build up number */ while (n++ < size) |