[SCM] libav/experimental: use the adjustment value present in FLV to crop VP6 video

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:52:32 UTC 2013


The following commit has been merged in the experimental branch:
commit 9e2424ce60b5a5e39478593106f7199e72b71f2d
Author: Aurelien Jacobs <aurel at gnuage.org>
Date:   Sun Oct 22 23:19:42 2006 +0000

    use the adjustment value present in FLV to crop VP6 video
    
    Originally committed as revision 6770 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index de6b61d..6d5d46b 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -64,6 +64,10 @@ static int vp6_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size,
         if (16*cols != s->avctx->coded_width ||
             16*rows != s->avctx->coded_height) {
             avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
+            if (s->avctx->extradata_size == 1) {
+                s->avctx->width  -= s->avctx->extradata[0] >> 4;
+                s->avctx->height -= s->avctx->extradata[0] & 0x0F;
+            }
             res = 2;
         }
 
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index f9eefb1..87984b5 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -193,7 +193,12 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
             case 3: st->codec->codec_id = CODEC_ID_FLASHSV; break;
             case 4:
                 st->codec->codec_id = CODEC_ID_VP6F;
-                get_byte(&s->pb); /* width and height adjustment */
+                if (st->codec->extradata_size != 1) {
+                    st->codec->extradata_size = 1;
+                    st->codec->extradata = av_malloc(1);
+                }
+                /* width and height adjustment */
+                st->codec->extradata[0] = get_byte(&s->pb);
                 size--;
                 break;
             default:

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list