comparison mpeg12.c @ 10589:02c7c0a5ad7d libavcodec

Move mpeg_decode_postinit() out of bitstream decoding functions, it does not belong in there.
author michael
date Sat, 28 Nov 2009 21:32:33 +0000
parents 96b9deb2adb1
children 0c6e62729784
comparison
equal deleted inserted replaced
10588:96b9deb2adb1 10589:02c7c0a5ad7d
1350 { 1350 {
1351 Mpeg1Context *s1 = avctx->priv_data; 1351 Mpeg1Context *s1 = avctx->priv_data;
1352 MpegEncContext *s = &s1->mpeg_enc_ctx; 1352 MpegEncContext *s = &s1->mpeg_enc_ctx;
1353 int ref, f_code, vbv_delay; 1353 int ref, f_code, vbv_delay;
1354 1354
1355 if(mpeg_decode_postinit(s->avctx) < 0)
1356 return -2;
1357
1358 init_get_bits(&s->gb, buf, buf_size*8); 1355 init_get_bits(&s->gb, buf, buf_size*8);
1359 1356
1360 ref = get_bits(&s->gb, 10); /* temporal ref */ 1357 ref = get_bits(&s->gb, 10); /* temporal ref */
1361 s->pict_type = get_bits(&s->gb, 3); 1358 s->pict_type = get_bits(&s->gb, 3);
1362 if(s->pict_type == 0 || s->pict_type > 3) 1359 if(s->pict_type == 0 || s->pict_type > 3)
2302 mpeg1_decode_sequence(avctx, buf_ptr, 2299 mpeg1_decode_sequence(avctx, buf_ptr,
2303 input_size); 2300 input_size);
2304 break; 2301 break;
2305 2302
2306 case PICTURE_START_CODE: 2303 case PICTURE_START_CODE:
2304 if(mpeg_decode_postinit(avctx) < 0){
2305 av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n");
2306 return -1;
2307 }
2308
2307 /* we have a complete image: we try to decompress it */ 2309 /* we have a complete image: we try to decompress it */
2308 if(mpeg1_decode_picture(avctx, 2310 if(mpeg1_decode_picture(avctx,
2309 buf_ptr, input_size) < 0) 2311 buf_ptr, input_size) < 0)
2310 s2->pict_type=0; 2312 s2->pict_type=0;
2311 break; 2313 break;