Give a little better name to the magic(_id) field in xvmc struct

Originally committed as revision 17310 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Ivan Kalvachev 16 years ago
parent 49674dd052
commit a0723a4d84
  1. 10
      libavcodec/mpegvideo_xvmc.c
  2. 2
      libavcodec/xvmc.h

@ -38,7 +38,7 @@
void ff_xvmc_init_block(MpegEncContext *s) void ff_xvmc_init_block(MpegEncContext *s)
{ {
struct xvmc_render_state *render = (struct xvmc_render_state*)s->current_picture.data[2]; struct xvmc_render_state *render = (struct xvmc_render_state*)s->current_picture.data[2];
if (!render || render->magic != AV_XVMC_RENDER_MAGIC) { if (!render || render->magic_id != AV_XVMC_RENDER_MAGIC) {
assert(0); assert(0);
return; // make sure that this is a render packet return; // make sure that this is a render packet
} }
@ -69,7 +69,7 @@ int ff_xvmc_field_start(MpegEncContext*s, AVCodecContext *avctx)
struct xvmc_render_state *last, *next, *render = (struct xvmc_render_state*)s->current_picture.data[2]; struct xvmc_render_state *last, *next, *render = (struct xvmc_render_state*)s->current_picture.data[2];
assert(avctx); assert(avctx);
if (!render || render->magic != AV_XVMC_RENDER_MAGIC) if (!render || render->magic_id != AV_XVMC_RENDER_MAGIC)
return -1; // make sure that this is a render packet return -1; // make sure that this is a render packet
render->picture_structure = s->picture_structure; render->picture_structure = s->picture_structure;
@ -92,7 +92,7 @@ int ff_xvmc_field_start(MpegEncContext*s, AVCodecContext *avctx)
next = (struct xvmc_render_state*)s->next_picture.data[2]; next = (struct xvmc_render_state*)s->next_picture.data[2];
if (!next) if (!next)
return -1; return -1;
if (next->magic != AV_XVMC_RENDER_MAGIC) if (next->magic_id != AV_XVMC_RENDER_MAGIC)
return -1; return -1;
render->p_future_surface = next->p_surface; render->p_future_surface = next->p_surface;
// no return here, going to set forward prediction // no return here, going to set forward prediction
@ -100,7 +100,7 @@ int ff_xvmc_field_start(MpegEncContext*s, AVCodecContext *avctx)
last = (struct xvmc_render_state*)s->last_picture.data[2]; last = (struct xvmc_render_state*)s->last_picture.data[2];
if (!last) if (!last)
last = render; // predict second field from the first last = render; // predict second field from the first
if (last->magic != AV_XVMC_RENDER_MAGIC) if (last->magic_id != AV_XVMC_RENDER_MAGIC)
return -1; return -1;
render->p_past_surface = last->p_surface; render->p_past_surface = last->p_surface;
return 0; return 0;
@ -154,7 +154,7 @@ void ff_xvmc_decode_mb(MpegEncContext *s)
// start of XVMC-specific code // start of XVMC-specific code
render = (struct xvmc_render_state*)s->current_picture.data[2]; render = (struct xvmc_render_state*)s->current_picture.data[2];
assert(render); assert(render);
assert(render->magic == AV_XVMC_RENDER_MAGIC); assert(render->magic_id == AV_XVMC_RENDER_MAGIC);
assert(render->mv_blocks); assert(render->mv_blocks);
// take the next free macroblock // take the next free macroblock

@ -36,7 +36,7 @@
struct xvmc_render_state { struct xvmc_render_state {
/** set by calling application */ /** set by calling application */
//@{ //@{
int magic; ///< used as a check against memory corruption by regular pixel routines int magic_id; ///< used as a check against memory corruption by regular pixel routines or other API structure
short* data_blocks; short* data_blocks;
XvMCMacroBlock* mv_blocks; XvMCMacroBlock* mv_blocks;

Loading…
Cancel
Save