changeset 9056:4180f20569c1 libavcodec

Initialize H264 parser context correctly if the optional SEI messages are not present. Patch by Ivan Schreter, schreter gmx net
author cehoyos
date Thu, 26 Feb 2009 20:36:02 +0000
parents 15515243f476
children 0adefec7e2b4
files h264_parser.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/h264_parser.c	Thu Feb 26 02:30:29 2009 +0000
+++ b/h264_parser.c	Thu Feb 26 20:36:02 2009 +0000
@@ -260,9 +260,15 @@
 
         parse_nal_units(s, avctx, buf, buf_size);
 
+        if (h->sei_cpb_removal_delay >= 0) {
         s->dts_sync_point    = h->sei_buffering_period_present;
         s->dts_ref_dts_delta = h->sei_cpb_removal_delay;
         s->pts_dts_delta     = h->sei_dpb_output_delay;
+        } else {
+            s->dts_sync_point    = INT_MIN;
+            s->dts_ref_dts_delta = INT_MIN;
+            s->pts_dts_delta     = INT_MIN;
+        }
     }
 
     *poutbuf = buf;