summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Jie <chenj@lemote.com>2013-05-17 20:17:31 +0800
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-20 13:23:52 +0200
commit0a90994b990fc80b5ee187924942cf717ad28746 (patch)
treed588226d2ed4b206e59d12f35878f7016dc26093
parent15f4154b6af56989a2c661cb515dad67cc374e3d (diff)
downloadgstreamer-plugins-bad-0a90994b990fc80b5ee187924942cf717ad28746.tar.gz
androidmedia: fix a minor error in COLOR_FormatYUV420Planar converting
https://bugzilla.gnome.org/show_bug.cgi?id=700521
-rw-r--r--sys/androidmedia/gstamcvideodec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index 250f951cf..cffc1792a 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -841,13 +841,20 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, gint idx,
src += self->crop_left;
row_length = self->width;
} else if (i > 0) {
+ /* skip the Y plane */
src += slice_height * stride;
- src += self->crop_top * src_stride;
+
+ /* crop_top/crop_left divided by two
+ * because one byte of the U/V planes
+ * corresponds to two pixels horizontally/vertically */
+ src += self->crop_top / 2 * src_stride;
src += self->crop_left / 2;
row_length = (self->width + 1) / 2;
}
- if (i == 2)
+ if (i == 2) {
+ /* skip the U plane */
src += ((slice_height + 1) / 2) * ((stride + 1) / 2);
+ }
dest = GST_VIDEO_FRAME_COMP_DATA (&vframe, i);
height = GST_VIDEO_FRAME_COMP_HEIGHT (&vframe, i);