summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-01-17 10:46:50 +0000
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-04-04 10:58:50 +0100
commit6b887060b1d6eadf5ea47a17cb9dfd62050609b7 (patch)
tree5c631356566ae0a1f66c1d4570a6991644f8c015
parentfffcbfc1277a4cc05670f7ae43e70736210ea17d (diff)
mpeg2dec: do not reset the whole video info when setting size
New changes to gstvideo will reset all the video info state when calling _set_format, overwriting what was previously set in the preceding code. The comment says the following code is meant to preserve the pre-crop size, so let's just keep the size and related data as this does not seem to break anything else (this is what the _set_format call would have set before the change that reset all data, except the colorimetry).
-rw-r--r--ext/mpeg2dec/gstmpeg2dec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c
index 16f9b8b0..b50b4754 100644
--- a/ext/mpeg2dec/gstmpeg2dec.c
+++ b/ext/mpeg2dec/gstmpeg2dec.c
@@ -590,6 +590,7 @@ handle_sequence (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info)
GstVideoCodecState *state;
GstVideoInfo *dinfo = &mpeg2dec->decoded_info;
GstVideoInfo *vinfo;
+ GstVideoInfo pre_crop_info;
GstVideoFormat format;
sequence = info->sequence;
@@ -760,7 +761,13 @@ handle_sequence (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info)
/* we store the codec size before cropping */
*dinfo = *vinfo;
- gst_video_info_set_format (dinfo, format, sequence->width, sequence->height);
+ gst_video_info_set_format (&pre_crop_info, format, sequence->width,
+ sequence->height);
+ dinfo->width = sequence->width;
+ dinfo->height = sequence->height;
+ dinfo->size = pre_crop_info.size;
+ memcpy (dinfo->stride, pre_crop_info.stride, sizeof (pre_crop_info.stride));
+ memcpy (dinfo->offset, pre_crop_info.offset, sizeof (pre_crop_info.offset));
/* Mpeg2dec has 2 frame latency to produce a picture and 1 frame latency in
* it's parser */