codecparsers: h264: fix derivation of MaxPicNum variable.
authorGwenole Beauchesne <gb.devel@gmail.com>
Mon, 10 Nov 2014 09:01:24 +0000 (10:01 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 14 Nov 2014 08:36:27 +0000 (09:36 +0100)
The logic to compute the MaxPicNum variable was reversed. In paricular,
MaxPicNum is double MaxFrameNum only if field_pic_flag is set to 1.

https://bugzilla.gnome.org/show_bug.cgi?id=739291

gst-libs/gst/codecparsers/gsth264parser.c

index 6b1f35a45242ea2cef6d950575af0826ad918057..4df2bad0d2c58e44d0ca06c35503ad04e3d8ecac 100644 (file)
@@ -2176,9 +2176,9 @@ gst_h264_parser_parse_slice_hdr (GstH264NalParser * nalparser,
 
   /* calculate MaxPicNum */
   if (slice->field_pic_flag)
-    slice->max_pic_num = sps->max_frame_num;
-  else
     slice->max_pic_num = 2 * sps->max_frame_num;
+  else
+    slice->max_pic_num = sps->max_frame_num;
 
   if (nalu->idr_pic_flag)
     READ_UE_ALLOWED (&nr, slice->idr_pic_id, 0, G_MAXUINT16);