Revision baced9f5 libavcodec/mpeg12.c

View differences:

libavcodec/mpeg12.c
314 314
                put_header(s, EXT_START_CODE);
315 315
                put_bits(&s->pb, 4, 1); //seq ext
316 316
                put_bits(&s->pb, 1, 0); //esc
317
                put_bits(&s->pb, 3, 4); //profile
318
                put_bits(&s->pb, 4, 8); //level
317
                
318
                if(s->avctx->profile == FF_PROFILE_UNKNOWN){
319
                    put_bits(&s->pb, 3, 4); //profile
320
                }else{
321
                    put_bits(&s->pb, 3, s->avctx->profile); //profile
322
                }
323

  
324
                if(s->avctx->level == FF_LEVEL_UNKNOWN){
325
                    put_bits(&s->pb, 4, 8); //level
326
                }else{
327
                    put_bits(&s->pb, 4, s->avctx->level); //level
328
                }
329

  
319 330
                put_bits(&s->pb, 1, s->progressive_sequence);
320 331
                put_bits(&s->pb, 2, 1); //chroma format 4:2:0
321 332
                put_bits(&s->pb, 2, 0); //horizontal size ext
......
1971 1982
{
1972 1983
    int horiz_size_ext, vert_size_ext;
1973 1984
    int bit_rate_ext;
1974
    int level, profile;
1975 1985

  
1976 1986
    skip_bits(&s->gb, 1); /* profil and level esc*/
1977
    profile= get_bits(&s->gb, 3);
1978
    level= get_bits(&s->gb, 4);
1987
    s->avctx->profile= get_bits(&s->gb, 3);
1988
    s->avctx->level= get_bits(&s->gb, 4);
1979 1989
    s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
1980 1990
    s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
1981 1991
    horiz_size_ext = get_bits(&s->gb, 2);
......
1999 2009

  
2000 2010
    if(s->avctx->debug & FF_DEBUG_PICT_INFO)
2001 2011
        av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d vbv buffer: %d, bitrate:%d\n", 
2002
               profile, level, s->avctx->rc_buffer_size, s->bit_rate);
2012
               s->avctx->profile, s->avctx->level, s->avctx->rc_buffer_size, s->bit_rate);
2003 2013

  
2004 2014
}
2005 2015

  

Also available in: Unified diff