mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
videotestsrc: Do not try to answer the duration query before negotiation
We have no idea at that moment and this code was trying to divide by 0! Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/705>
This commit is contained in:
parent
b813c40788
commit
75065ab244
1 changed files with 6 additions and 4 deletions
|
@ -1029,10 +1029,12 @@ gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery * query)
|
|||
gint64 dur;
|
||||
|
||||
GST_OBJECT_LOCK (src);
|
||||
dur = gst_util_uint64_scale_int_round (bsrc->num_buffers
|
||||
* GST_SECOND, src->info.fps_d, src->info.fps_n);
|
||||
res = TRUE;
|
||||
gst_query_set_duration (query, GST_FORMAT_TIME, dur);
|
||||
if (src->info.fps_n) {
|
||||
dur = gst_util_uint64_scale_int_round (bsrc->num_buffers
|
||||
* GST_SECOND, src->info.fps_d, src->info.fps_n);
|
||||
res = TRUE;
|
||||
gst_query_set_duration (query, GST_FORMAT_TIME, dur);
|
||||
}
|
||||
GST_OBJECT_UNLOCK (src);
|
||||
goto done;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue