Skip to content
Snippets Groups Projects
Commit 9806b9ab authored by Martin Storsjö's avatar Martin Storsjö
Browse files

Revert "Don't use expressions with side effects in macro parameters"


This reverts commit 25bacd0a.

Since 230b1c07, the bytewise AV_W*() macros only expand their
argument once, so revert to the more readable version of these.

Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent f79d8474
No related branches found
No related tags found
No related merge requests found
...@@ -121,10 +121,8 @@ static int dxv_decompress_dxt1(AVCodecContext *avctx) ...@@ -121,10 +121,8 @@ static int dxv_decompress_dxt1(AVCodecContext *avctx)
int pos = 2; int pos = 2;
/* Copy the first two elements */ /* Copy the first two elements */
value = bytestream2_get_le32(gbc); AV_WL32(ctx->tex_data, bytestream2_get_le32(gbc));
AV_WL32(ctx->tex_data, value); AV_WL32(ctx->tex_data + 4, bytestream2_get_le32(gbc));
value = bytestream2_get_le32(gbc);
AV_WL32(ctx->tex_data + 4, value);
/* Process input until the whole texture has been filled */ /* Process input until the whole texture has been filled */
while (pos + 2 <= ctx->tex_size / 4) { while (pos + 2 <= ctx->tex_size / 4) {
...@@ -174,14 +172,10 @@ static int dxv_decompress_dxt5(AVCodecContext *avctx) ...@@ -174,14 +172,10 @@ static int dxv_decompress_dxt5(AVCodecContext *avctx)
int probe, check; int probe, check;
/* Copy the first four elements */ /* Copy the first four elements */
value = bytestream2_get_le32(gbc); AV_WL32(ctx->tex_data + 0, bytestream2_get_le32(gbc));
AV_WL32(ctx->tex_data + 0, value); AV_WL32(ctx->tex_data + 4, bytestream2_get_le32(gbc));
value = bytestream2_get_le32(gbc); AV_WL32(ctx->tex_data + 8, bytestream2_get_le32(gbc));
AV_WL32(ctx->tex_data + 4, value); AV_WL32(ctx->tex_data + 12, bytestream2_get_le32(gbc));
value = bytestream2_get_le32(gbc);
AV_WL32(ctx->tex_data + 8, value);
value = bytestream2_get_le32(gbc);
AV_WL32(ctx->tex_data + 12, value);
/* Process input until the whole texture has been filled */ /* Process input until the whole texture has been filled */
while (pos + 2 <= ctx->tex_size / 4) { while (pos + 2 <= ctx->tex_size / 4) {
......
...@@ -512,10 +512,8 @@ static int xmv_fetch_video_packet(AVFormatContext *s, ...@@ -512,10 +512,8 @@ static int xmv_fetch_video_packet(AVFormatContext *s,
* WMV2 is little-endian. * WMV2 is little-endian.
* TODO: This manual swap is of course suboptimal. * TODO: This manual swap is of course suboptimal.
*/ */
for (i = 0; i < frame_size; i += 4) { for (i = 0; i < frame_size; i += 4)
uint32_t val = avio_rl32(pb); AV_WB32(pkt->data + i, avio_rl32(pb));
AV_WB32(pkt->data + i, val);
}
pkt->stream_index = video->stream_index; pkt->stream_index = video->stream_index;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment