st/va: MPEG4 call vlVaDecoderFixMPEG4Startcode()
authorMichael Varga <Michael.Varga@amd.com>
Thu, 23 Oct 2014 15:45:20 +0000 (10:45 -0500)
committerLeo Liu <leo.liu@amd.com>
Mon, 10 Nov 2014 15:24:07 +0000 (10:24 -0500)
If the VOP and GOV headers were truncated they will be regenerated.

Signed-off-by: Michael Varga <Michael.Varga@amd.com>
src/gallium/state_trackers/va/picture.c

index 7107231fa725559e06422c0315d93ec66e298097..9b94b397b075813b9d7b41c64f4aeefe046b8865 100644 (file)
@@ -503,6 +503,13 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)
          buffers[num_buffers] = (void *const)&start_code_vc1;
          sizes[num_buffers++] = sizeof(start_code_vc1);
       break;
+   case PIPE_VIDEO_FORMAT_MPEG4:
+      if (bufHasStartcode(buf, 0x000001, 24))
+         break;
+
+      vlVaDecoderFixMPEG4Startcode(context);
+      buffers[num_buffers] = (void *)context->mpeg4.start_code;
+      sizes[num_buffers++] = context->mpeg4.start_code_size;
    default:
       break;
    }