vp8dec: Use outputstate when copying output buffer data

Using the input state was causing a crash because the strides/offsets
would be wrong. Fix it by using the output as we are dealing with
the decoded frame.
This commit is contained in:
Thiago Santos 2012-04-27 09:05:57 -03:00 committed by Sebastian Dröge
parent 7fee866764
commit 44d22d3e82

View file

@ -326,7 +326,11 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img,
{
int stride, w, h, i;
guint8 *d;
GstVideoInfo *info = &dec->input_state->info;
GstVideoCodecState *outputstate;
GstVideoInfo *info;
outputstate = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (dec));
info = &outputstate->info;
d = GST_BUFFER_DATA (buffer) + GST_VIDEO_INFO_COMP_OFFSET (info, 0);
stride = GST_VIDEO_INFO_COMP_STRIDE (info, 0);
@ -354,6 +358,8 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img,
for (i = 0; i < h; i++)
memcpy (d + i * stride,
img->planes[VPX_PLANE_V] + i * img->stride[VPX_PLANE_V], w);
gst_video_codec_state_unref (outputstate);
}
static GstFlowReturn