Browse Source

H.264: move avctx->{profile,level} init before AVCodecContext.get_format().

Originally committed as revision 22884 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Gwenole Beauchesne 16 years ago
parent
commit
fa37cf0db3
1 changed files with 2 additions and 6 deletions
  1. +2
    -6
      libavcodec/h264.c

+ 2
- 6
libavcodec/h264.c View File

@@ -1777,6 +1777,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
} }
h->sps = *h0->sps_buffers[h->pps.sps_id]; h->sps = *h0->sps_buffers[h->pps.sps_id];


s->avctx->profile = h->sps.profile_idc;
s->avctx->level = h->sps.level_idc;
s->avctx->refs= h->sps.ref_frame_count; s->avctx->refs= h->sps.ref_frame_count;


if(h == h0 && h->dequant_coeff_pps != pps_id){ if(h == h0 && h->dequant_coeff_pps != pps_id){
@@ -2818,9 +2820,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
if((err = decode_slice_header(hx, h))) if((err = decode_slice_header(hx, h)))
break; break;


avctx->profile = hx->sps.profile_idc;
avctx->level = hx->sps.level_idc;

if (h->current_slice == 1) { if (h->current_slice == 1) {
if (s->avctx->hwaccel && s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0) if (s->avctx->hwaccel && s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
return -1; return -1;
@@ -2856,9 +2855,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
if ((err = decode_slice_header(hx, h)) < 0) if ((err = decode_slice_header(hx, h)) < 0)
break; break;


avctx->profile = hx->sps.profile_idc;
avctx->level = hx->sps.level_idc;

hx->s.data_partitioning = 1; hx->s.data_partitioning = 1;


break; break;


Loading…
Cancel
Save