summaryrefslogtreecommitdiff
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2014-03-31 17:46:29 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-04-09 02:12:19 +0200
commitf6774f905fb3cfdc319523ac640be30b14c1bc55 (patch)
tree6f0db53a2febce58c562d383e1f3f61c9c256275 /libavcodec/h263dec.c
parent60fd7d36c47d62d4c603bf16c213b1a924f5cfcf (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/h263dec.c')
-rw-r--r--libavcodec/h263dec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index f6c79af189..ad1b31d036 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -374,7 +374,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (buf_size == 0) {
/* special case for last picture */
if (s->low_delay == 0 && s->next_picture_ptr) {
- if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0)
return ret;
s->next_picture_ptr = NULL;
@@ -419,7 +419,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/* We need to set current_picture_ptr before reading the header,
* otherwise we cannot store anyting in there */
- if (s->current_picture_ptr == NULL || s->current_picture_ptr->f.data[0]) {
+ if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
int i = ff_find_unused_picture(s, 0);
if (i < 0)
return i;
@@ -506,8 +506,8 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->gob_index = ff_h263_get_gob_height(s);
// for skipping the frame
- s->current_picture.f.pict_type = s->pict_type;
- s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+ s->current_picture.f->pict_type = s->pict_type;
+ s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
/* skip B-frames if we don't have reference frames */
if (s->last_picture_ptr == NULL &&
@@ -611,15 +611,15 @@ intrax8_decoded:
if (!s->divx_packed && avctx->hwaccel)
ff_thread_finish_setup(avctx);
- assert(s->current_picture.f.pict_type ==
- s->current_picture_ptr->f.pict_type);
- assert(s->current_picture.f.pict_type == s->pict_type);
+ assert(s->current_picture.f->pict_type ==
+ s->current_picture_ptr->f->pict_type);
+ assert(s->current_picture.f->pict_type == s->pict_type);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
- if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->current_picture_ptr);
} else if (s->last_picture_ptr != NULL) {
- if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
+ if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
return ret;
ff_print_debug_info(s, s->last_picture_ptr);
}