Revision ea3c2d53

View differences:

libavcodec/vp3.c
2109 2109
static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
2110 2110
{
2111 2111
    Vp3DecodeContext *s = avctx->priv_data;
2112
    int visible_width, visible_height;
2112
    int visible_width, visible_height, colorspace;
2113 2113

  
2114 2114
    s->theora = get_bits_long(gb, 24);
2115 2115
    av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);
......
2146 2146

  
2147 2147
    if (s->theora < 0x030200)
2148 2148
        skip_bits(gb, 5); /* keyframe frequency force */
2149
    skip_bits(gb, 8); /* colorspace */
2149
    colorspace = get_bits(gb, 8);
2150 2150
    skip_bits(gb, 24); /* bitrate */
2151 2151

  
2152 2152
    skip_bits(gb, 6); /* quality hint */
......
2166 2166
    else
2167 2167
        avcodec_set_dimensions(avctx, s->width, s->height);
2168 2168

  
2169
    if (colorspace == 1) {
2170
        avctx->color_primaries = AVCOL_PRI_BT470M;
2171
    } else if (colorspace == 2) {
2172
        avctx->color_primaries = AVCOL_PRI_BT470BG;
2173
    }
2174
    if (colorspace == 1 || colorspace == 2) {
2175
        avctx->colorspace = AVCOL_SPC_BT470BG;
2176
        avctx->color_trc  = AVCOL_TRC_BT709;
2177
    }
2178

  
2169 2179
    return 0;
2170 2180
}
2171 2181

  

Also available in: Unified diff