[FFmpeg-devel] h264: fix RTSP stream decoding

sergey at gavrushkin.com sergey at gavrushkin.com
Wed Jan 3 11:54:03 EET 2018


> The error code returned by decode_extradata_ps() is inconsistent after this
> its not "if any failed" it is returning an error if the last failed 

Sorry, I don't get how it is supposed to work. I just found the previous implementation and checked which commit broke it.

The other possible solution on upper level: 

---------------------------------------

From 9fcd003a095b19b9e2fb5f6af3cc57a9e131f308 Mon Sep 17 00:00:00 2001
From: Sergey Gavrushkin <sergey at gavrushkin.com>
Date: Wed, 3 Jan 2018 12:51:15 +0300
Subject: [PATCH] libavcodec/h264: fix decoding

Fixes ticket #6422. It is a regression fix for an issue that was introduced in commit
98c97994c5b90bdae02accb155eeceeb5224b8ef. Variable err_recognition is
ignored while extradata is decoded and the whole decoding process is
failed due to timeout.

Signed-off-by: Sergey Gavrushkin <sergey at gavrushkin.com>
---
 libavcodec/h264_parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index fee28d9..403fd39 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -487,7 +487,7 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps,
     } else {
         *is_avc = 0;
         ret = decode_extradata_ps(data, size, ps, 0, logctx);
-        if (ret < 0)
+        if (ret < 0 && (err_recognition & AV_EF_EXPLODE))
             return ret;
     }
     return size;
--
2.6.4


Thank you, 
Sergey


More information about the ffmpeg-devel mailing list