dst->release_buffer = src->release_buffer;
dst->opaque = src->opaque;
- dst->dsp_mask = src->dsp_mask;
dst->debug = src->debug;
dst->debug_mv = src->debug_mv;
* If we're still receiving the initial packets, don't return a frame.
*/
- if (fctx->delaying && avpkt->size) {
+ if (fctx->delaying) {
if (fctx->next_decoding >= (avctx->thread_count-1)) fctx->delaying = 0;
*got_picture_ptr=0;
- return avpkt->size;
+ if (avpkt->size)
+ return avpkt->size;
}
/*
*picture = p->frame;
*got_picture_ptr = p->got_frame;
picture->pkt_dts = p->avpkt.dts;
- picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
- picture->width = avctx->width;
- picture->height = avctx->height;
- picture->format = avctx->pix_fmt;
/*
* A later call with avkpt->size == 0 may loop over all threads,
fctx->next_decoding = fctx->next_finished = 0;
fctx->delaying = 1;
fctx->prev_thread = NULL;
+ for (int i = 0; i < avctx->thread_count; i++) {
+ PerThreadContext *p = &fctx->threads[i];
+ // Make sure decode flush calls with size=0 won't return old frames
+ p->got_frame = 0;
+
+ release_delayed_buffers(p);
+ }
}
static int *allocate_progress(PerThreadContext *p)
ff_thread_finish_setup(avctx);
}
+ if (err) {
+ free_progress(f);
+ f->thread_opaque = NULL;
+ }
pthread_mutex_unlock(&p->parent->buffer_mutex);
return err;