aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-12-01 22:30:03 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-12-01 22:30:03 +0000
commit94f28061f572b5946275cd29be0683c22cd58a18 (patch)
tree7688bcac6cba8ff8c3eb716e1f80c7536bf57251 /libavcodec
parente7e578b73c453ad22c553b8be5535aa3b861cd83 (diff)
downloadffmpeg-94f28061f572b5946275cd29be0683c22cd58a18.tar.gz
Store original width/height so that rv20 does not get stuck with some
resolution. A sample file to show a difference is at issue833 (http://airfarce.com/video/000211fh.rm) Originally committed as revision 20691 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.h1
-rw-r--r--libavcodec/rv10.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 89b983f59d..63d342de62 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -571,6 +571,7 @@ typedef struct MpegEncContext {
/* RV10 specific */
int rv10_version; ///< RV10 version: 0 or 3
int rv10_first_dc_coded[3];
+ int orig_width, orig_height;
/* MJPEG specific */
struct MJpegContext *mjpeg_ctx;
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 64d506fe7a..e1c5ed2f29 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -362,8 +362,8 @@ static int rv20_decode_picture_header(MpegEncContext *s)
new_w= 4*((uint8_t*)s->avctx->extradata)[6+2*f];
new_h= 4*((uint8_t*)s->avctx->extradata)[7+2*f];
}else{
- new_w= s->width; //FIXME wrong we of course must save the original in the context
- new_h= s->height;
+ new_w= s->orig_width ;
+ new_h= s->orig_height;
}
if(new_w != s->width || new_h != s->height){
av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h);
@@ -453,8 +453,8 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
s->out_format = FMT_H263;
s->codec_id= avctx->codec_id;
- s->width = avctx->coded_width;
- s->height = avctx->coded_height;
+ s->orig_width = s->width = avctx->coded_width;
+ s->orig_height= s->height = avctx->coded_height;
s->h263_long_vectors= ((uint8_t*)avctx->extradata)[3] & 1;
avctx->sub_id= AV_RB32((uint8_t*)avctx->extradata + 4);