mpeg2dec: Fix latency calculation
authorJan Schmidt <jan@centricular.com>
Wed, 1 Mar 2017 12:00:55 +0000 (23:00 +1100)
committerJan Schmidt <jan@centricular.com>
Wed, 1 Mar 2017 12:04:00 +0000 (23:04 +1100)
The latency calculation was missing a scaling by GST_SECOND,
so it would always report a tiny latency. Fix that.

Spotted by Guillaume Desmottes.

ext/mpeg2dec/gstmpeg2dec.c

index 137c7ea..48f294e 100644 (file)
@@ -807,7 +807,7 @@ handle_sequence (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info)
 
   /* Mpeg2dec has 2 frame latency to produce a picture and 1 frame latency in
    * it's parser */
-  latency = gst_util_uint64_scale (3, vinfo->fps_d, vinfo->fps_n);
+  latency = gst_util_uint64_scale (3 * GST_SECOND, vinfo->fps_d, vinfo->fps_n);
   gst_video_decoder_set_latency (GST_VIDEO_DECODER (mpeg2dec), latency,
       latency);