aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/prosumer.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-01-12 21:56:14 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-20 21:42:20 +0100
commitd3b76c9993238508ac7e727088c2b27c46834848 (patch)
treeb4765e2ce849ff73c936910bf9f664443095e3ce /libavcodec/prosumer.c
parentec28a85107cccece4dce17c0ccb633defe2d6e98 (diff)
downloadffmpeg-d3b76c9993238508ac7e727088c2b27c46834848.tar.gz
avcodec/prosumer: Simplify code slightly in decompress()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/prosumer.c')
-rw-r--r--libavcodec/prosumer.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c
index 505de71980..3fa9986a38 100644
--- a/libavcodec/prosumer.c
+++ b/libavcodec/prosumer.c
@@ -84,16 +84,13 @@ static int decompress(GetByteContext *gb, int size, PutByteContext *pb, const ui
if (bytestream2_get_bytes_left(gb) <= 0) {
if (!a)
return 0;
- cnt = 4;
} else {
- pos = bytestream2_tell(gb) ^ 2;
- bytestream2_seek(gb, pos, SEEK_SET);
+ pos = bytestream2_tell(gb);
+ bytestream2_seek(gb, pos ^ 2, SEEK_SET);
AV_WN16(&a, bytestream2_peek_le16(gb));
- pos = pos ^ 2;
- bytestream2_seek(gb, pos, SEEK_SET);
- bytestream2_skip(gb, 2);
- cnt = 4;
+ bytestream2_seek(gb, pos + 2, SEEK_SET);
}
+ cnt = 4;
}
c--;
}
@@ -117,12 +114,10 @@ static int decompress(GetByteContext *gb, int size, PutByteContext *pb, const ui
}
return 0;
}
- pos = bytestream2_tell(gb) ^ 2;
- bytestream2_seek(gb, pos, SEEK_SET);
+ pos = bytestream2_tell(gb);
+ bytestream2_seek(gb, pos ^ 2, SEEK_SET);
AV_WN16(&a, bytestream2_peek_le16(gb));
- pos = pos ^ 2;
- bytestream2_seek(gb, pos, SEEK_SET);
- bytestream2_skip(gb, 2);
+ bytestream2_seek(gb, pos + 2, SEEK_SET);
cnt = 4;
idx--;
}