Remove the extended_data workaround, all decoders should now handle this
properly.
uint8_t *buf; ///< backup storage for packet data when the input packet is not refcounted
int allocated_buf_size; ///< Size allocated for buf
uint8_t *buf; ///< backup storage for packet data when the input packet is not refcounted
int allocated_buf_size; ///< Size allocated for buf
- AVFrame frame; ///< Output frame (for decoding) or input (for encoding).
+ AVFrame *frame; ///< Output frame (for decoding) or input (for encoding).
int got_frame; ///< The output of got_picture_ptr from the last avcodec_decode_video() call.
int result; ///< The result of the last codec decode/encode() call.
int got_frame; ///< The output of got_picture_ptr from the last avcodec_decode_video() call.
int result; ///< The result of the last codec decode/encode() call.
ff_thread_finish_setup(avctx);
pthread_mutex_lock(&p->mutex);
ff_thread_finish_setup(avctx);
pthread_mutex_lock(&p->mutex);
- avcodec_get_frame_defaults(&p->frame);
+ av_frame_unref(p->frame);
- p->result = codec->decode(avctx, &p->frame, &p->got_frame, &p->avpkt);
-
- /* many decoders assign whole AVFrames, thus overwriting extended_data;
- * make sure it's set correctly */
- p->frame.extended_data = p->frame.data;
+ p->result = codec->decode(avctx, p->frame, &p->got_frame, &p->avpkt);
if (p->state == STATE_SETTING_UP) ff_thread_finish_setup(avctx);
if (p->state == STATE_SETTING_UP) ff_thread_finish_setup(avctx);
pthread_mutex_unlock(&p->progress_mutex);
}
pthread_mutex_unlock(&p->progress_mutex);
}
- av_frame_move_ref(picture, &p->frame);
+ av_frame_move_ref(picture, p->frame);
*got_picture_ptr = p->got_frame;
picture->pkt_dts = p->avpkt.dts;
*got_picture_ptr = p->got_frame;
picture->pkt_dts = p->avpkt.dts;
avctx->codec = NULL;
release_delayed_buffers(p);
avctx->codec = NULL;
release_delayed_buffers(p);
- av_frame_unref(&p->frame);
+ av_frame_free(&p->frame);
}
for (i = 0; i < thread_count; i++) {
}
for (i = 0; i < thread_count; i++) {
pthread_cond_init(&p->progress_cond, NULL);
pthread_cond_init(&p->output_cond, NULL);
pthread_cond_init(&p->progress_cond, NULL);
pthread_cond_init(&p->output_cond, NULL);
+ p->frame = av_frame_alloc();
+ if (!p->frame) {
+ err = AVERROR(ENOMEM);
+ goto error;
+ }
+
p->parent = fctx;
p->avctx = copy;
p->parent = fctx;
p->avctx = copy;
PerThreadContext *p = &fctx->threads[i];
// Make sure decode flush calls with size=0 won't return old frames
p->got_frame = 0;
PerThreadContext *p = &fctx->threads[i];
// Make sure decode flush calls with size=0 won't return old frames
p->got_frame = 0;
- av_frame_unref(&p->frame);
+ av_frame_unref(p->frame);
release_delayed_buffers(p);
}
release_delayed_buffers(p);
}