comparison h261.c @ 2270:21f450be6cb5 libavcodec

lowres width/height cleanup 3rd try
author michael
date Mon, 27 Sep 2004 11:50:56 +0000
parents 514949de5d15
children 89a5e4601343
comparison
equal deleted inserted replaced
2269:535b7dfee202 2270:21f450be6cb5
116 116
117 // set defaults 117 // set defaults
118 MPV_decode_defaults(s); 118 MPV_decode_defaults(s);
119 s->avctx = avctx; 119 s->avctx = avctx;
120 120
121 s->width = s->avctx->width >> avctx->lowres; 121 s->width = s->avctx->coded_width;
122 s->height = s->avctx->height >> avctx->lowres; 122 s->height = s->avctx->coded_height;
123 s->codec_id = s->avctx->codec->id; 123 s->codec_id = s->avctx->codec->id;
124 124
125 s->out_format = FMT_H261; 125 s->out_format = FMT_H261;
126 s->low_delay= 1; 126 s->low_delay= 1;
127 avctx->pix_fmt= PIX_FMT_YUV420P; 127 avctx->pix_fmt= PIX_FMT_YUV420P;
713 if (ret < 0){ 713 if (ret < 0){
714 av_log(s->avctx, AV_LOG_ERROR, "header damaged\n"); 714 av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
715 return -1; 715 return -1;
716 } 716 }
717 717
718 if (s->width >> avctx->lowres != avctx->width || s->height >> avctx->lowres != avctx->height){ 718 if (s->width != avctx->coded_width || s->height != avctx->coded_height){
719 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat 719 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
720 s->parse_context.buffer=0; 720 s->parse_context.buffer=0;
721 MPV_common_end(s); 721 MPV_common_end(s);
722 s->parse_context= pc; 722 s->parse_context= pc;
723 } 723 }
724 if (!s->context_initialized) { 724 if (!s->context_initialized) {
725 avctx->width = s->width >> avctx->lowres; 725 avcodec_set_dimensions(avctx, s->width, s->height);
726 avctx->height = s->height >> avctx->lowres;
727 726
728 goto retry; 727 goto retry;
729 } 728 }
730 729
731 // for hurry_up==5 730 // for hurry_up==5