Revision a0723a4d

View differences:

libavcodec/mpegvideo_xvmc.c
38 38
void ff_xvmc_init_block(MpegEncContext *s)
39 39
{
40 40
    struct xvmc_render_state *render = (struct xvmc_render_state*)s->current_picture.data[2];
41
    if (!render || render->magic != AV_XVMC_RENDER_MAGIC) {
41
    if (!render || render->magic_id != AV_XVMC_RENDER_MAGIC) {
42 42
        assert(0);
43 43
        return; // make sure that this is a render packet
44 44
    }
......
69 69
    struct xvmc_render_state *last, *next, *render = (struct xvmc_render_state*)s->current_picture.data[2];
70 70

  
71 71
    assert(avctx);
72
    if (!render || render->magic != AV_XVMC_RENDER_MAGIC)
72
    if (!render || render->magic_id != AV_XVMC_RENDER_MAGIC)
73 73
        return -1; // make sure that this is a render packet
74 74

  
75 75
    render->picture_structure = s->picture_structure;
......
92 92
            next = (struct xvmc_render_state*)s->next_picture.data[2];
93 93
            if (!next)
94 94
                return -1;
95
            if (next->magic != AV_XVMC_RENDER_MAGIC)
95
            if (next->magic_id != AV_XVMC_RENDER_MAGIC)
96 96
                return -1;
97 97
            render->p_future_surface = next->p_surface;
98 98
            // no return here, going to set forward prediction
......
100 100
            last = (struct xvmc_render_state*)s->last_picture.data[2];
101 101
            if (!last)
102 102
                last = render; // predict second field from the first
103
            if (last->magic != AV_XVMC_RENDER_MAGIC)
103
            if (last->magic_id != AV_XVMC_RENDER_MAGIC)
104 104
                return -1;
105 105
            render->p_past_surface = last->p_surface;
106 106
            return 0;
......
154 154
    // start of XVMC-specific code
155 155
    render = (struct xvmc_render_state*)s->current_picture.data[2];
156 156
    assert(render);
157
    assert(render->magic == AV_XVMC_RENDER_MAGIC);
157
    assert(render->magic_id == AV_XVMC_RENDER_MAGIC);
158 158
    assert(render->mv_blocks);
159 159

  
160 160
    // take the next free macroblock
libavcodec/xvmc.h
36 36
struct xvmc_render_state {
37 37
/** set by calling application */
38 38
//@{
39
    int             magic;                        ///< used as a check against memory corruption by regular pixel routines
39
    int             magic_id;                     ///< used as a check against memory corruption by regular pixel routines or other API structure
40 40

  
41 41
    short*          data_blocks;
42 42
    XvMCMacroBlock* mv_blocks;

Also available in: Unified diff