[vlc-commits] transcode: use the picture_chain API

Steve Lhomme git at videolan.org
Wed Sep 23 16:17:58 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 17 16:43:51 2020 +0200| [d831e3fb5afca7f09fa5662a396f966a49784739] | committer: Steve Lhomme

transcode: use the picture_chain API

id->fifo.pic.first represents the picture chain and id->fifo.pic.tail the tail
that is used to append pictures.

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

 modules/stream_out/transcode/video.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 1bcbfb9d38..d1ffb567b3 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -149,13 +149,15 @@ static void decoder_queue_video( decoder_t *p_dec, picture_t *p_pic )
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
     sout_stream_id_sys_t *id = p_owner->id;
 
+    assert(!picture_HasChainedPics(p_pic));
     vlc_mutex_lock(&id->fifo.lock);
     if (id->fifo.pic.first == NULL)
+    {
         id->fifo.pic.first = p_pic;
+        id->fifo.pic.tail = p_pic;
+    }
     else
-        id->fifo.pic.tail->p_next = p_pic;
-    id->fifo.pic.tail = p_pic;
-    assert(p_pic->p_next == NULL);
+        id->fifo.pic.tail = vlc_picture_chain_Append( id->fifo.pic.tail, p_pic );
     vlc_mutex_unlock(&id->fifo.lock);
 }
 
@@ -525,12 +527,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
 
     do
     {
-        picture_t *p_pic = p_pics;
-        if( p_pic )
-        {
-            p_pics = p_pic->p_next;
-            p_pic->p_next = NULL;
-        }
+        picture_t *p_pic = vlc_picture_chain_PopFront( &p_pics );
 
         if( id->b_error && p_pic )
         {



More information about the vlc-commits mailing list