From 63bb1e3a4d24cf01cfcf235e25b8bf737c834f7a Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 19 Mar 2019 12:31:35 +0900 Subject: [PATCH] qtdemux: Don't pass zero to denominator for framerate Need to respect return of gst_video_guess_framerate() to ensure non-zero denominator. This patch is to fix below error with an abnormal (but has valid frame) file. (gst-play-1.0:17940): GStreamer-CRITICAL **: passed '0' as denominator for `GstFraction' --- gst/isomp4/qtdemux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 502085ba5e..cf15fad46d 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -8522,8 +8522,9 @@ gst_qtdemux_guess_framerate (GstQTDemux * qtdemux, QtDemuxStream * stream) GST_TIME_FORMAT, duration, first_duration, n_samples - 1, GST_TIME_ARGS (avg_duration)); - gst_video_guess_framerate (avg_duration, &CUR_STREAM (stream)->fps_n, - &CUR_STREAM (stream)->fps_d); + fps_available = + gst_video_guess_framerate (avg_duration, + &CUR_STREAM (stream)->fps_n, &CUR_STREAM (stream)->fps_d); GST_DEBUG_OBJECT (qtdemux, "Calculating framerate, timescale %u gave fps_n %d fps_d %d",