[vlc-commits] vout: destroy the private pool while resetting the decoder pool

Rémi Denis-Courmont git at videolan.org
Sat Nov 1 13:31:07 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov  1 13:25:36 2014 +0200| [1f08e25399b1aedb14e1836af3a5d9ac8b9cf905] | committer: Rémi Denis-Courmont

vout: destroy the private pool while resetting the decoder pool

Otherwise picture references from the private pool get clobbered.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f08e25399b1aedb14e1836af3a5d9ac8b9cf905
---

 src/video_output/video_output.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 2fc8f65..16054d6 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1199,8 +1199,21 @@ static void ThreadFlush(vout_thread_t *vout, bool below, mtime_t date)
 static void ThreadReset(vout_thread_t *vout)
 {
     ThreadFlush(vout, true, INT64_MAX);
-    if (vout->p->decoder_pool)
+    if (vout->p->decoder_pool) {
+        unsigned count;
+
+        if (vout->p->private_pool != NULL) {
+            count = picture_pool_GetSize(vout->p->private_pool);
+            picture_pool_Delete(vout->p->private_pool);
+        }
         picture_pool_Reset(vout->p->decoder_pool);
+        if (vout->p->private_pool != NULL) {
+            vout->p->private_pool = picture_pool_Reserve(vout->p->decoder_pool,
+                                                         count);
+            if (vout->p->private_pool == NULL)
+                abort();
+        }
+    }
     vout->p->pause.is_on = false;
     vout->p->pause.date  = mdate();
 }



More information about the vlc-commits mailing list