[vlc-commits] videotoolbox: convert Annex B to avvC

Thomas Guillem git at videolan.org
Fri Jul 31 15:43:10 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jul 30 16:45:37 2015 +0200| [5ef42a880f6d90a3a4eb5fe96da6afcf271e0a83] | committer: Felix Paul Kühne

videotoolbox: convert Annex B to avvC

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

 modules/codec/videotoolbox.m |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index f67bca5..e1ac985 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -714,15 +714,12 @@ static CFDataRef ESDSCreate(decoder_t *p_dec, uint8_t *p_buf, uint32_t i_buf_siz
     return data;
 }
 
-static bool H264ProcessBlock(decoder_t *p_dec, block_t *p_block)
+static block_t *H264ProcessBlock(decoder_t *p_dec, block_t *p_block)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    if (!p_block->p_buffer)
-        return false;
-
     if (p_sys->b_is_avcc)
-        return true;
+        return p_block;
 
     uint8_t *p_sps_buf = NULL, *p_pps_buf = NULL;
     size_t i_sps_size = 0, i_pps_size = 0;
@@ -768,12 +765,13 @@ static bool H264ProcessBlock(decoder_t *p_dec, block_t *p_block)
                 p_sys->codec_profile = sps_data.i_profile;
                 p_sys->codec_level = sps_data.i_level;
                 StopVideoToolbox(p_dec);
-                return false;
+                block_Release(p_block);
+                return NULL;
             }
         }
     }
 
-    return true;
+    return convert_annexb_to_h264(p_block, p_sys->i_nal_length_size);
 }
 
 static CMSampleBufferRef VTSampleBufferCreate(decoder_t *p_dec,
@@ -899,7 +897,9 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block)
             }
 
             if (p_sys->codec == kCMVideoCodecType_H264) {
-                if (!H264ProcessBlock(p_dec, p_block)) {
+                p_block = H264ProcessBlock(p_dec, p_block);
+                if (!p_block)
+                {
                     *pp_block = NULL;
                     return NULL;
                 }



More information about the vlc-commits mailing list