[vlc-devel] [PATCH] videotoolbox: add legacy error codes printing

Marvin Scholz epirat07 at gmail.com
Fri Aug 7 15:13:48 CEST 2020


---
 modules/codec/videotoolbox.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
index 5e5b30f0a27..13689d3e70a 100644
--- a/modules/codec/videotoolbox.c
+++ b/modules/codec/videotoolbox.c
@@ -1681,6 +1681,9 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
 #define VTERRCASE(x) \
     case x: msg_Warn(p_dec, "vt session error: '" #x "'"); break;
 
+#define VTERRCASE_LEGACY(code, name) \
+    case code: msg_Warn(p_dec, "vt session error: '" name "'"); break;
+
     switch (status)
     {
         case noErr:
@@ -1716,10 +1719,17 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
         VTERRCASE(kVTCouldNotFindTemporalFilterErr)
         VTERRCASE(kVTPixelTransferNotPermittedErr)
         VTERRCASE(kVTColorCorrectionImageRotationFailedErr)
+
+        /* Legacy error codes defined in the old Carbon MacErrors.h */
+        VTERRCASE_LEGACY(-8960, "codecErr")
+        VTERRCASE_LEGACY(-8961, "noCodecErr")
+        VTERRCASE_LEGACY(-8969, "codecBadDataErr")
+        VTERRCASE_LEGACY(-8973, "codecOpenErr")
         default:
             msg_Warn(p_dec, "unknown vt session error (%i)", (int)status);
     }
 #undef VTERRCASE
+#undef VTERRCASE_LEGACY
 
     if (p_vtsession_status)
     {
-- 
2.24.3 (Apple Git-128)



More information about the vlc-devel mailing list