Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-20 04:50:59 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-08-20 04:50:59 +0400
commitb1acf5d7a646b98df9bbc59650baf6ded024ec86 (patch)
tree8a0c37df7d60b66cf5960e8fb929cef70b8f3041 /libavcodec/avrndec.c
parentba2cf854d03ac8f563af5f71dfba27f7bd857a06 (diff)
AVRn: fix progressive
Fixes Ticket970 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/avrndec.c')
-rw-r--r--libavcodec/avrndec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index b173c6dcf4..83180f08b5 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -76,6 +76,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
AVFrame *p = &a->frame;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
+ int true_height = buf_size / (2*avctx->width);
int y;
if(a->is_mjpeg)
@@ -97,7 +98,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
p->key_frame= 1;
if(a->interlace) {
- int true_height = buf_size / (2*avctx->width);
buf += (true_height - avctx->height)*avctx->width;
for(y = 0; y < avctx->height-1; y+=2) {
memcpy(p->data[0] + (y+ a->tff)*p->linesize[0], buf , 2*avctx->width);
@@ -105,6 +105,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
buf += 2*avctx->width;
}
} else {
+ buf += (true_height - avctx->height)*avctx->width*2;
for(y = 0; y < avctx->height; y++) {
memcpy(p->data[0] + y*p->linesize[0], buf, 2*avctx->width);
buf += 2*avctx->width;