[vlc-commits] decoder: cc: detect/auto raise reorder depth

Francois Cartegnie git at videolan.org
Fri Sep 15 11:16:26 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Sep 15 10:49:55 2017 +0200| [423254ada71b2f72a111bbd4dae96ec1784e86a4] | committer: Francois Cartegnie

decoder: cc: detect/auto raise reorder depth

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

 modules/codec/cc.c        | 8 ++++++++
 modules/packetizer/h264.c | 2 +-
 modules/packetizer/hevc.c | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 8d4f091e41..34c02fde51 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -400,7 +400,15 @@ static void Push( decoder_t *p_dec, block_t *p_block )
         if( p_block->i_pts == VLC_TS_INVALID || (*pp_block)->i_pts == VLC_TS_INVALID )
             continue;
         if( p_block->i_pts < (*pp_block)->i_pts )
+        {
+            if( p_sys->i_reorder_depth > 0 &&
+                p_sys->i_queue < p_sys->i_reorder_depth &&
+                pp_block == &p_sys->p_queue )
+            {
+                msg_Info( p_dec, "Increasing reorder depth to %d", ++p_sys->i_reorder_depth );
+            }
             break;
+        }
     }
     /* Insert, keeping a pts and/or fifo ordered list */
     p_block->p_next = *pp_block ? *pp_block : NULL;
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 44582f1fe9..152a14a08c 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -488,7 +488,7 @@ static block_t *PacketizeAVC1( decoder_t *p_dec, block_t **pp_block )
  *****************************************************************************/
 static block_t *GetCc( decoder_t *p_dec, bool pb_present[4], int *pi_reorder_depth )
 {
-    *pi_reorder_depth = 0;
+    *pi_reorder_depth = 4;
     return cc_storage_get_current( p_dec->p_sys->p_ccs, pb_present );
 }
 
diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 73e8bc6886..ca8a86583e 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -306,7 +306,7 @@ static void PacketizeFlush( decoder_t *p_dec )
  *****************************************************************************/
 static block_t *GetCc( decoder_t *p_dec, bool pb_present[4], int *pi_reorder_depth )
 {
-    *pi_reorder_depth = 0;
+    *pi_reorder_depth = 4;
     return cc_storage_get_current( p_dec->p_sys->p_ccs, pb_present );
 }
 



More information about the vlc-commits mailing list