emms_c(); //needed to avoid an emms_c() call before every return;
- if (ret < 0 && picture->buf[0])
- av_frame_unref(picture);
-
if (*got_picture_ptr) {
if (!avctx->refcounted_frames) {
avci->to_free = *picture;
}
avctx->frame_number++;
- }
+ } else
+ av_frame_unref(picture);
} else
ret = 0;