summaryrefslogtreecommitdiff
path: root/libavcodec/vda_h264.c
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2015-04-02 13:43:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-02 15:06:28 +0200
commit3e53211a578fc6b042ceff45b2702335294e0464 (patch)
treef8f482d0aa854d286c67b1923a3c1d7a447cd077 /libavcodec/vda_h264.c
parent764f87b6ab8eb08f909a347fd3a804a935f5ea2b (diff)
vda: fix h264 decoding for avcC,vda wants the entire buffer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vda_h264.c')
-rw-r--r--libavcodec/vda_h264.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c
index 081c366013..b6b9ab4a89 100644
--- a/libavcodec/vda_h264.c
+++ b/libavcodec/vda_h264.c
@@ -320,9 +320,20 @@ static int vda_h264_start_frame(AVCodecContext *avctx,
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;
}
@@ -333,6 +344,9 @@ static int vda_h264_decode_slice(AVCodecContext *avctx,
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);