[vlc-commits] videotoolbox: improve error case handling

Felix Paul Kühne git at videolan.org
Thu Dec 10 12:12:25 CET 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Dec 10 12:10:03 2015 +0100| [0b3d62f0ce0f564e85f9c8e67fe1a31116429bf2] | committer: Felix Paul Kühne

videotoolbox: improve error case handling

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

 modules/codec/videotoolbox.m |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 1764781..5b590ad 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1034,17 +1034,11 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block)
                         msg_Err(p_dec, "decoder failure: invalid argument");
                         p_dec->b_error = true;
                     } else if (status == -8969 || status == -12909) {
-                        msg_Err(p_dec, "decoder failure: bad data");
+                        msg_Err(p_dec, "decoder failure: bad data (%i)", status);
+                        StopVideoToolbox(p_dec);
+                    } else if (status == -8960 || status == -12911) {
+                        msg_Err(p_dec, "decoder failure: internal malfunction (%i)", status);
                         StopVideoToolbox(p_dec);
-                        if (likely(sampleBuffer != nil))
-                            CFRelease(sampleBuffer);
-                        sampleBuffer = nil;
-                        block_Release(p_block);
-                        *pp_block = NULL;
-                        return NULL;
-                    } else if (status == -12911 || status == -8960) {
-                        msg_Err(p_dec, "decoder failure: internal malfunction");
-                        p_dec->b_error = true;
                     } else
                         msg_Dbg(p_dec, "decoding frame failed (%i)", status);
                 }



More information about the vlc-commits mailing list