From 27408ee47f73a830cf00b9cf81e420345982be25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 30 Mar 2012 13:52:56 +0200 Subject: [PATCH] theoradec: Add crop metadata before mapping the buffer content Otherwise the buffer is not writable and the crop metadata can't be added. --- ext/theora/gsttheoradec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index 8a4279f..ed44141 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -1132,10 +1132,6 @@ theora_handle_image (GstTheoraDec * dec, th_ycbcr_buffer buf, GstBuffer ** out) if (G_UNLIKELY (result != GST_FLOW_OK)) goto no_buffer; - if G_UNLIKELY - (!gst_video_frame_map (&frame, &dec->vinfo, *out, GST_MAP_WRITE)) - goto invalid_frame; - if (!dec->has_cropping) { /* we need to crop the hard way */ offset_x = dec->info.pic_x; @@ -1171,6 +1167,10 @@ theora_handle_image (GstTheoraDec * dec, th_ycbcr_buffer buf, GstBuffer ** out) GST_CAT_TRACE_OBJECT (GST_CAT_PERFORMANCE, dec, "doing unavoidable video frame copy"); + if G_UNLIKELY + (!gst_video_frame_map (&frame, &dec->vinfo, *out, GST_MAP_WRITE)) + goto invalid_frame; + for (comp = 0; comp < 3; comp++) { width = GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (frame.info.finfo, comp, pic_width); -- 2.7.4