]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/videotoolboxenc.c
Merge commit '01f1f017d831cf14617aaaeafcec3ae3a81efce7'
[ffmpeg] / libavcodec / videotoolboxenc.c
index 638f278cd0f3ae5ec4a9ea82badfc1866a7efd5a..eba6cc672f81d7fe7af02aa8c5d453500e02cfd8 100644 (file)
@@ -73,11 +73,11 @@ static struct{
 
 #define GET_SYM(symbol, defaultVal)                                     \
 do{                                                                     \
-    CFStringRef cfstr = *(CFStringRef*)dlsym(RTLD_DEFAULT, #symbol);    \
-    if(!cfstr)                                                          \
+    CFStringRef* handle = (CFStringRef*)dlsym(RTLD_DEFAULT, #symbol);   \
+    if(!handle)                                                         \
         compat_keys.symbol = CFSTR(defaultVal);                         \
     else                                                                \
-        compat_keys.symbol = cfstr;                                     \
+        compat_keys.symbol = *handle;                                   \
 }while(0)
 
 static pthread_once_t once_ctrl = PTHREAD_ONCE_INIT;
@@ -1285,7 +1285,7 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
                                    kCFAllocatorDefault,
                                    &has_b_frames_cfbool);
 
-    if (!status) {
+    if (!status && has_b_frames_cfbool) {
         //Some devices don't output B-frames for main profile, even if requested.
         vtctx->has_b_frames = CFBooleanGetValue(has_b_frames_cfbool);
         CFRelease(has_b_frames_cfbool);
@@ -1599,7 +1599,7 @@ static int copy_replace_length_codes(
             remaining_dst_size--;
 
             wrote_bytes = write_sei(sei,
-                                    SEI_TYPE_USER_DATA_REGISTERED,
+                                    H264_SEI_TYPE_USER_DATA_REGISTERED,
                                     dst_data,
                                     remaining_dst_size);
 
@@ -1655,7 +1655,7 @@ static int copy_replace_length_codes(
                 return status;
 
             wrote_bytes = write_sei(sei,
-                                    SEI_TYPE_USER_DATA_REGISTERED,
+                                    H264_SEI_TYPE_USER_DATA_REGISTERED,
                                     new_sei,
                                     remaining_dst_size - old_sei_length);
             if (wrote_bytes < 0)
@@ -1751,7 +1751,7 @@ static int vtenc_cm_to_avpacket(
 
     if (sei) {
         size_t msg_size = get_sei_msg_bytes(sei,
-                                            SEI_TYPE_USER_DATA_REGISTERED);
+                                            H264_SEI_TYPE_USER_DATA_REGISTERED);
 
         sei_nalu_size = sizeof(start_code) + 1 + msg_size + 1;
     }