[vlc-commits] codec: hxxx_helper: don't parse hevc streams with h264 parser

Pierre Lamot git at videolan.org
Mon Mar 29 12:15:46 UTC 2021


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Mar 19 19:03:57 2021 +0100| [fa2684404772ad7dd8e500f271fad93c9132be3d] | committer: Pierre Lamot

codec: hxxx_helper: don't parse hevc streams with h264 parser

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

 modules/codec/hxxx_helper.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index 33df5f6bce..dae1838a4e 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -556,7 +556,7 @@ helper_process_block_hevc_annexb(struct hxxx_helper *hh, block_t *p_block,
 }
 
 static block_t *
-helper_process_block_xvcc2annexb(struct hxxx_helper *hh, block_t *p_block,
+helper_process_block_h264_xvcc2annexb(struct hxxx_helper *hh, block_t *p_block,
                                  bool *p_config_changed)
 {
     assert(helper_nal_length_valid(hh));
@@ -565,6 +565,16 @@ helper_process_block_xvcc2annexb(struct hxxx_helper *hh, block_t *p_block,
     return helper_process_block_h264_annexb(hh, p_block, p_config_changed);
 }
 
+static block_t *
+helper_process_block_hevc_xvcc2annexb(struct hxxx_helper *hh, block_t *p_block,
+                                 bool *p_config_changed)
+{
+    assert(helper_nal_length_valid(hh));
+    h264_AVC_to_AnnexB(p_block->p_buffer, p_block->i_buffer,
+                       hh->i_nal_length_size);
+    return helper_process_block_hevc_annexb(hh, p_block, p_config_changed);
+}
+
 static block_t *
 helper_process_block_h264_annexb2avcc(struct hxxx_helper *hh, block_t *p_block,
                                       bool *p_config_changed)
@@ -646,7 +656,7 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void *p_extra,
                 if (hh->b_need_xvcC)
                     hh->pf_process_block = helper_process_block_h264_avcc;
                 else
-                    hh->pf_process_block = helper_process_block_xvcc2annexb;
+                    hh->pf_process_block = helper_process_block_h264_xvcc2annexb;
             }
             else /* AnnexB */
             {
@@ -662,7 +672,7 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void *p_extra,
                 if (hh->b_need_xvcC)
                     hh->pf_process_block = helper_process_block_hevc_hvcc;
                 else
-                    hh->pf_process_block = helper_process_block_xvcc2annexb;
+                    hh->pf_process_block = helper_process_block_hevc_xvcc2annexb;
             }
             else /* AnnexB */
             {



More information about the vlc-commits mailing list