decode_postinit(h, nal_index >= nals_needed);
if (h->avctx->hwaccel &&
- (ret = h->avctx->hwaccel->start_frame(h->avctx, NULL, 0)) < 0)
+ (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0)
return ret;
if (CONFIG_H264_VDPAU_DECODER &&
h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
uint32_t size)
{
VDAContext *vda = avctx->internal->hwaccel_priv_data;
-
- vda->bitstream_size = 0;
-
+ H264Context *h = avctx->priv_data;
+
+ if (h->is_avc == 1) {
+ void *tmp;
+ vda->bitstream_size = 0;
+ tmp = av_fast_realloc(vda->bitstream,
+ &vda->allocated_size,
+ size);
+ vda->bitstream = tmp;
+ memcpy(vda->bitstream, buffer, size);
+ vda->bitstream_size = size;
+ } else {
+ vda->bitstream_size = 0;
+ }
return 0;
}
VDAContext *vda = avctx->internal->hwaccel_priv_data;
void *tmp;
+ if (h->is_avc == 1)
+ return 0;
+
tmp = av_fast_realloc(vda->bitstream,
&vda->allocated_size,
vda->bitstream_size + size + 4);