}
if (context->decoder->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)
- context->decoder->begin_frame(context->decoder, context->target, &context->desc.base);
+ context->needs_begin_frame = true;
return VA_STATUS_SUCCESS;
}
if (!context->decoder)
return VA_STATUS_ERROR_ALLOCATION_FAILED;
+
+ context->needs_begin_frame = true;
}
return vaStatus;
sizes[num_buffers] = buf->size;
++num_buffers;
- context->decoder->begin_frame(context->decoder, context->target,
- &context->desc.base);
+ if (context->needs_begin_frame) {
+ context->decoder->begin_frame(context->decoder, context->target,
+ &context->desc.base);
+ context->needs_begin_frame = false;
+ }
context->decoder->decode_bitstream(context->decoder, context->target, &context->desc.base,
num_buffers, (const void * const*)buffers, sizes);
}