summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-12-09 16:47:53 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-12-15 15:46:34 +0100
commitd75190aa93206c02cb4f18a66d2c927d6a0198e1 (patch)
tree348f19ef22c3df732596d44353462e17fc8c4f1e /libavcodec/mpegvideo.c
parent63fcedcf01247f15b72c0d1f959bb3b612853ba8 (diff)
mpegvideo: move REBASE_PICTURE where it is used
Drop an unused #undef from h264 decoder.
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index e6a48cd935..44cf8c53bd 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -961,6 +961,11 @@ do {\
UPDATE_PICTURE(last_picture);
UPDATE_PICTURE(next_picture);
+#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
+ ((pic && pic >= old_ctx->picture && \
+ pic < old_ctx->picture + MAX_PICTURE_COUNT) ? \
+ &new_ctx->picture[pic - old_ctx->picture] : NULL)
+
s->last_picture_ptr = REBASE_PICTURE(s1->last_picture_ptr, s, s1);
s->current_picture_ptr = REBASE_PICTURE(s1->current_picture_ptr, s, s1);
s->next_picture_ptr = REBASE_PICTURE(s1->next_picture_ptr, s, s1);