changeset 11422:56266eb23fb7 libavcodec

vp3: Allocate a dummy reference frame if we have no keyframe
author conrad
date Tue, 09 Mar 2010 00:29:22 +0000
parents 438b6d4096a8
children c2e932f83f99
files vp3.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vp3.c	Tue Mar 09 00:29:19 2010 +0000
+++ b/vp3.c	Tue Mar 09 00:29:22 2010 +0000
@@ -1835,8 +1835,14 @@
         }
     } else {
         if (!s->golden_frame.data[0]) {
-            av_log(s->avctx, AV_LOG_ERROR, "vp3: first frame not a keyframe\n");
-            goto error;
+            av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
+            s->golden_frame.reference = 3;
+            if (avctx->get_buffer(avctx, &s->golden_frame) < 0) {
+                av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+                goto error;
+            }
+            s->last_frame = s->golden_frame;
+            s->last_frame.type = FF_BUFFER_TYPE_COPY;
         }
     }