[vlc-commits] snapshot: use the picture_chain API

Steve Lhomme git at videolan.org
Wed Sep 23 16:18:10 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep 21 13:07:47 2020 +0200| [679faa131cd448ffe27096ac30560c74226bf7c3] | committer: Steve Lhomme

snapshot: use the picture_chain API

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

 src/video_output/snapshot.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/video_output/snapshot.c b/src/video_output/snapshot.c
index 7afe460217..01eed7e275 100644
--- a/src/video_output/snapshot.c
+++ b/src/video_output/snapshot.c
@@ -73,8 +73,7 @@ void vout_snapshot_Destroy(vout_snapshot_t *snap)
         return;
 
     while (snap->picture) {
-        picture_t *picture = snap->picture;
-        snap->picture = picture->p_next;
+        picture_t *picture = vlc_picture_chain_PopFront( &snap->picture );
         picture_Release(picture);
     }
 
@@ -112,10 +111,8 @@ picture_t *vout_snapshot_Get(vout_snapshot_t *snap, vlc_tick_t timeout)
         vlc_cond_timedwait(&snap->wait, &snap->lock, deadline) == 0);
 
     /* */
-    picture_t *picture = snap->picture;
-    if (picture)
-        snap->picture = picture->p_next;
-    else if (snap->request_count > 0)
+    picture_t *picture = vlc_picture_chain_PopFront( &snap->picture );
+    if (!picture && snap->request_count > 0)
         snap->request_count--;
 
     vlc_mutex_unlock(&snap->lock);
@@ -161,8 +158,7 @@ void vout_snapshot_Set(vout_snapshot_t *snap,
         }
         else
         {
-            snap->tail->p_next = dup;
-            snap->tail =  dup;
+            snap->tail = vlc_picture_chain_Append( snap->tail, dup );
         }
         snap->request_count--;
     }



More information about the vlc-commits mailing list