diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-03-31 17:46:29 +0000 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-04-09 02:12:19 +0200 |
commit | f6774f905fb3cfdc319523ac640be30b14c1bc55 (patch) | |
tree | 6f0db53a2febce58c562d383e1f3f61c9c256275 /libavcodec/vaapi_mpeg4.c | |
parent | 60fd7d36c47d62d4c603bf16c213b1a924f5cfcf (diff) |
mpegvideo: operate with pointers to AVFrames instead of whole structs
The most interesting parts are initialization in ff_MPV_common_init() and
uninitialization in ff_MPV_common_end().
ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL
checks for Picture.f, because these functions can be called on
uninitialized or partially initialized Pictures.
NULL pointer checks are added to ff_thread_release_buffer() stub function.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/vaapi_mpeg4.c')
-rw-r--r-- | libavcodec/vaapi_mpeg4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c index 098b37a8ad..fc3a15e610 100644 --- a/libavcodec/vaapi_mpeg4.c +++ b/libavcodec/vaapi_mpeg4.c @@ -81,7 +81,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_ pic_param->quant_precision = s->quant_precision; pic_param->vop_fields.value = 0; /* reset all bits */ pic_param->vop_fields.bits.vop_coding_type = s->pict_type - AV_PICTURE_TYPE_I; - pic_param->vop_fields.bits.backward_reference_vop_coding_type = s->pict_type == AV_PICTURE_TYPE_B ? s->next_picture.f.pict_type - AV_PICTURE_TYPE_I : 0; + pic_param->vop_fields.bits.backward_reference_vop_coding_type = s->pict_type == AV_PICTURE_TYPE_B ? s->next_picture.f->pict_type - AV_PICTURE_TYPE_I : 0; pic_param->vop_fields.bits.vop_rounding_type = s->no_rounding; pic_param->vop_fields.bits.intra_dc_vlc_thr = mpeg4_get_intra_dc_vlc_thr(ctx); pic_param->vop_fields.bits.top_field_first = s->top_field_first; @@ -95,9 +95,9 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_ pic_param->TRD = s->pp_time; if (s->pict_type == AV_PICTURE_TYPE_B) - pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture.f); + pic_param->backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f); if (s->pict_type != AV_PICTURE_TYPE_I) - pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture.f); + pic_param->forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f); /* Fill in VAIQMatrixBufferMPEG4 */ /* Only the first inverse quantisation method uses the weighting matrices */ |