# HG changeset patch # User conrad # Date 1268094559 0 # Node ID 438b6d4096a8457fe5a628ac4d7519a3e52d70ef # Parent 57e3c39078bf3c56b2f54c44d2edf8e67853b3c6 vp3: use FF_BUFFER_TYPE_COPY diff -r 57e3c39078bf -r 438b6d4096a8 vp3.c --- a/vp3.c Tue Mar 09 00:29:16 2010 +0000 +++ b/vp3.c Tue Mar 09 00:29:19 2010 +0000 @@ -1889,8 +1889,7 @@ /* release the last frame, if it is allocated and if it is not the * golden frame */ - if ((s->last_frame.data[0]) && - (s->last_frame.data[0] != s->golden_frame.data[0])) + if (s->last_frame.data[0] && s->last_frame.type != FF_BUFFER_TYPE_COPY) avctx->release_buffer(avctx, &s->last_frame); /* shuffle frames (last = current) */ @@ -1900,6 +1899,7 @@ if (s->golden_frame.data[0]) avctx->release_buffer(avctx, &s->golden_frame); s->golden_frame = s->current_frame; + s->last_frame.type = FF_BUFFER_TYPE_COPY; } s->current_frame.data[0]= NULL; /* ensure that we catch any access to this released frame */ @@ -1941,9 +1941,9 @@ free_vlc(&s->motion_vector_vlc); /* release all frames */ - if (s->golden_frame.data[0] && s->golden_frame.data[0] != s->last_frame.data[0]) + if (s->golden_frame.data[0]) avctx->release_buffer(avctx, &s->golden_frame); - if (s->last_frame.data[0]) + if (s->last_frame.data[0] && s->last_frame.type != FF_BUFFER_TYPE_COPY) avctx->release_buffer(avctx, &s->last_frame); /* no need to release the current_frame since it will always be pointing * to the same frame as either the golden or last frame */