gstavviddec: only set range when actually reported by avcodec

otherwise we get incomplete colorimetry that video-info complains about

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/70>
This commit is contained in:
Matej Knopp 2020-05-08 19:16:41 +02:00
parent e727ce548c
commit b1b49a0913

View file

@ -1259,8 +1259,10 @@ gst_ffmpegviddec_negotiate (GstFFMpegVidDec * ffmpegdec,
|| in_info->colorimetry.range == GST_VIDEO_COLOR_RANGE_UNKNOWN) {
if (context->color_range == AVCOL_RANGE_JPEG) {
out_info->colorimetry.range = GST_VIDEO_COLOR_RANGE_0_255;
} else {
} else if (context->color_range == AVCOL_RANGE_MPEG) {
out_info->colorimetry.range = GST_VIDEO_COLOR_RANGE_16_235;
} else {
out_info->colorimetry.range = GST_VIDEO_COLOR_RANGE_UNKNOWN;
}
}