diff mpeg12.c @ 2270:21f450be6cb5 libavcodec

lowres width/height cleanup 3rd try
author michael
date Mon, 27 Sep 2004 11:50:56 +0000
parents 514949de5d15
children 857e16e85aea
line wrap: on
line diff
--- a/mpeg12.c	Mon Sep 27 10:06:10 2004 +0000
+++ b/mpeg12.c	Mon Sep 27 11:50:56 2004 +0000
@@ -1966,8 +1966,8 @@
 
     if (
     	(s1->mpeg_enc_ctx_allocated == 0)|| 
-        avctx->width  != -((-s->width )>>avctx->lowres) ||
-        avctx->height != -((-s->height)>>avctx->lowres) ||
+        avctx->coded_width  != s->width ||
+        avctx->coded_height != s->height||
 //      s1->save_aspect_info != avctx->aspect_ratio_info||
         0)
     {
@@ -1979,8 +1979,7 @@
 	if( (s->width == 0 )||(s->height == 0))
 	    return -2;
 
-        avctx->width  = -((-s->width )>>avctx->lowres);
-        avctx->height = -((-s->height)>>avctx->lowres);
+        avcodec_set_dimensions(avctx, s->width, s->height);
         avctx->bit_rate = s->bit_rate;
         s1->save_aspect_info = s->aspect_ratio_info;
 
@@ -2776,8 +2775,8 @@
     if (s1->mpeg_enc_ctx_allocated) {
         MPV_common_end(s);
     }
-    s->width = avctx->width;
-    s->height = avctx->height;
+    s->width  = avctx->coded_width;
+    s->height = avctx->coded_height;
     avctx->has_b_frames= 0; //true?
     s->low_delay= 1;