comparison h264.c @ 11633:d47bd24cb380 libavcodec

H.264: move avctx->{profile,level} init before AVCodecContext.get_format().
author gb
date Thu, 15 Apr 2010 08:30:48 +0000
parents 9a5c269f31f5
children 456b580e244c
comparison
equal deleted inserted replaced
11632:9a5c269f31f5 11633:d47bd24cb380
1775 av_log(h->s.avctx, AV_LOG_ERROR, "non-existing SPS %u referenced\n", h->pps.sps_id); 1775 av_log(h->s.avctx, AV_LOG_ERROR, "non-existing SPS %u referenced\n", h->pps.sps_id);
1776 return -1; 1776 return -1;
1777 } 1777 }
1778 h->sps = *h0->sps_buffers[h->pps.sps_id]; 1778 h->sps = *h0->sps_buffers[h->pps.sps_id];
1779 1779
1780 s->avctx->profile = h->sps.profile_idc;
1781 s->avctx->level = h->sps.level_idc;
1780 s->avctx->refs= h->sps.ref_frame_count; 1782 s->avctx->refs= h->sps.ref_frame_count;
1781 1783
1782 if(h == h0 && h->dequant_coeff_pps != pps_id){ 1784 if(h == h0 && h->dequant_coeff_pps != pps_id){
1783 h->dequant_coeff_pps = pps_id; 1785 h->dequant_coeff_pps = pps_id;
1784 init_dequant_tables(h); 1786 init_dequant_tables(h);
2816 hx->s.data_partitioning = 0; 2818 hx->s.data_partitioning = 0;
2817 2819
2818 if((err = decode_slice_header(hx, h))) 2820 if((err = decode_slice_header(hx, h)))
2819 break; 2821 break;
2820 2822
2821 avctx->profile = hx->sps.profile_idc;
2822 avctx->level = hx->sps.level_idc;
2823
2824 if (h->current_slice == 1) { 2823 if (h->current_slice == 1) {
2825 if (s->avctx->hwaccel && s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0) 2824 if (s->avctx->hwaccel && s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
2826 return -1; 2825 return -1;
2827 if(CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) 2826 if(CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
2828 ff_vdpau_h264_picture_start(s); 2827 ff_vdpau_h264_picture_start(s);
2853 hx->intra_gb_ptr= 2852 hx->intra_gb_ptr=
2854 hx->inter_gb_ptr= NULL; 2853 hx->inter_gb_ptr= NULL;
2855 2854
2856 if ((err = decode_slice_header(hx, h)) < 0) 2855 if ((err = decode_slice_header(hx, h)) < 0)
2857 break; 2856 break;
2858
2859 avctx->profile = hx->sps.profile_idc;
2860 avctx->level = hx->sps.level_idc;
2861 2857
2862 hx->s.data_partitioning = 1; 2858 hx->s.data_partitioning = 1;
2863 2859
2864 break; 2860 break;
2865 case NAL_DPB: 2861 case NAL_DPB: