summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2010-03-09 00:29:22 +0000
committerDavid Conrad <lessen42@gmail.com>2010-03-09 00:29:22 +0000
commit7a4e8b59131cccd750cfcb78e41049982c66c1aa (patch)
tree42bf6342c9ba486ac36ba6a54e2aa0eeba3ae2aa /libavcodec/vp3.c
parent0c9afacbf5f89cbc56a8cf439db7567bbcb73c21 (diff)
vp3: Allocate a dummy reference frame if we have no keyframe
Originally committed as revision 22360 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index b874ee7f72..01438097b8 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1835,8 +1835,14 @@ static int vp3_decode_frame(AVCodecContext *avctx,
}
} 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;
}
}