[vlc-commits] codec: hxxx: refactor

Thomas Guillem git at videolan.org
Thu Apr 20 15:10:08 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Apr 20 14:08:38 2017 +0200| [0a5dabd030631fdcc6e22388d9975a16ebf7065b] | committer: Thomas Guillem

codec: hxxx: refactor

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

 modules/codec/hxxx_helper.c | 44 +++++++++++++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index 16479bcdae..fe241d2c6c 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -418,32 +418,42 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void *p_extra,
     if (i_ret != VLC_SUCCESS)
         return i_ret;
 
-    if (hh->b_is_xvcC)
-    {
-        if (hh->b_need_xvcC)
-            hh->pf_process_block = helper_process_block_dummy;
-        else
-            hh->pf_process_block = helper_process_block_xvcc2annexb;
-    }
-    else
+    switch (hh->i_codec)
     {
-        switch (hh->i_codec)
-        {
-            case VLC_CODEC_H264:
+        case VLC_CODEC_H264:
+            if (hh->b_is_xvcC)
+            {
+                if (hh->b_need_xvcC)
+                    hh->pf_process_block = helper_process_block_dummy;
+                else
+                    hh->pf_process_block = helper_process_block_xvcc2annexb;
+            }
+            else /* AnnexB */
+            {
                 if (hh->b_need_xvcC)
                     hh->pf_process_block = helper_process_block_h264_annexb2avcc;
                 else
                     hh->pf_process_block = helper_process_block_h264_annexb;
-                break;
-            case VLC_CODEC_HEVC:
+            }
+            break;
+        case VLC_CODEC_HEVC:
+            if (hh->b_is_xvcC)
+            {
+                if (hh->b_need_xvcC)
+                    hh->pf_process_block = helper_process_block_dummy;
+                else
+                    hh->pf_process_block = helper_process_block_xvcc2annexb;
+            }
+            else /* AnnexB */
+            {
                 if (hh->b_need_xvcC)
                     return VLC_EGENERIC; /* TODO */
                 else
                     hh->pf_process_block = helper_process_block_dummy;
-                break;
-            default:
-                vlc_assert_unreachable();
-        }
+            }
+            break;
+        default:
+            vlc_assert_unreachable();
     }
     return VLC_SUCCESS;;
 }



More information about the vlc-commits mailing list