diff options
authorVincent Penquerc'h <>2014-01-17 10:46:50 +0000
committerVincent Penquerc'h <>2014-04-04 11:04:03 +0100
commit463bc49ee21e39cc61d28cba9b00ba45a80a8da9 (patch)
parent5a9568e6f972948b08314ddd7264fbf277dd7373 (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).
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c
index 811e0525..55ed1441 100644
--- a/ext/mpeg2dec/gstmpeg2dec.c
+++ b/ext/mpeg2dec/gstmpeg2dec.c
@@ -589,6 +589,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;
@@ -759,7 +760,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 */