[FFmpeg-cvslog] rtpdec_hevc: do not print an error message if the received packet has a valid header but lacks additional bytes as payload

Thomas Volkert git at videolan.org
Sun Sep 21 15:18:47 CEST 2014


ffmpeg | branch: master | Thomas Volkert <thomas at homer-conferencing.com> | Sun Sep 21 13:50:12 2014 +0200| [dcdc1cbf4321071b933e14d59afc518321d2450a] | committer: Michael Niedermayer

rtpdec_hevc: do not print an error message if the received packet has a valid header but lacks additional bytes as payload

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dcdc1cbf4321071b933e14d59afc518321d2450a
---

 libavformat/rtpdec_hevc.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavformat/rtpdec_hevc.c b/libavformat/rtpdec_hevc.c
index 60a97e4..0916004 100644
--- a/libavformat/rtpdec_hevc.c
+++ b/libavformat/rtpdec_hevc.c
@@ -300,6 +300,7 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
 
         av_dlog(ctx, " FU type %d with %d bytes\n", fu_type, len);
 
+        /* sanity check for size of input packet: 1 byte payload at least */
         if (len > 0) {
             new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1);
             new_nal_header[1] = rtp_pl[1];
@@ -328,11 +329,14 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
                 memcpy(pkt->data, buf, len);
             }
         } else {
-            /* sanity check for size of input packet: 1 byte payload at least */
-            av_log(ctx, AV_LOG_ERROR,
-                   "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
-                   len, nal_type);
-            res = AVERROR_INVALIDDATA;
+            if (len < 0) {
+                av_log(ctx, AV_LOG_ERROR,
+                       "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
+                       len, nal_type);
+                res = AVERROR_INVALIDDATA;
+            } else {
+                res = AVERROR(EAGAIN);
+            }
         }
 
         break;



More information about the ffmpeg-cvslog mailing list