Index: media/filters/vpx_video_decoder.cc |
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc |
index f0dc03234093705cb8878a16f9485ea6333d305c..dc1d21d24268bf5aa8b2f584ab78f6c88932f71e 100644 |
--- a/media/filters/vpx_video_decoder.cc |
+++ b/media/filters/vpx_video_decoder.cc |
@@ -462,7 +462,6 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, |
VideoPixelFormat codec_format = PIXEL_FORMAT_YV12; |
int uv_rows = (vpx_image->d_h + 1) / 2; |
- ColorSpace color_space = COLOR_SPACE_UNSPECIFIED; |
if (vpx_image->fmt == VPX_IMG_FMT_I444) { |
CHECK(!vpx_codec_alpha_); |
codec_format = PIXEL_FORMAT_YV24; |
@@ -470,8 +469,14 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, |
} else if (vpx_codec_alpha_) { |
codec_format = PIXEL_FORMAT_YV12A; |
} |
+ |
+ // Default to the color space from the config, but if the bistream specifies |
+ // one, prefer that instead. |
+ ColorSpace color_space = config_.color_space(); |
if (vpx_image->cs == VPX_CS_BT_709) |
color_space = COLOR_SPACE_HD_REC709; |
+ else if (vpx_image->cs == VPX_CS_BT_601) |
+ color_space = COLOR_SPACE_SD_REC601; |
// The mixed |w|/|d_h| in |coded_size| is intentional. Setting the correct |
// coded width is necessary to allow coalesced memory access, which may avoid |