comparison h261.c @ 2266:514949de5d15 libavcodec

set AVCodecContext.width/height to the picture width/height instead of the one stored in the bitstream (that only matters if lowres!=0)
author michael
date Mon, 27 Sep 2004 02:39:55 +0000
parents 35fc37209ea0
children 21f450be6cb5
comparison
equal deleted inserted replaced
2265:c93da911905e 2266:514949de5d15
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; 121 s->width = s->avctx->width >> avctx->lowres;
122 s->height = s->avctx->height; 122 s->height = s->avctx->height >> avctx->lowres;
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->width || s->height != avctx->height){ 718 if (s->width >> avctx->lowres != avctx->width || s->height >> avctx->lowres != avctx->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; 725 avctx->width = s->width >> avctx->lowres;
726 avctx->height = s->height; 726 avctx->height = s->height >> avctx->lowres;
727 727
728 goto retry; 728 goto retry;
729 } 729 }
730 730
731 // for hurry_up==5 731 // for hurry_up==5