mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
gst/asfdemux/gstasfdemux.c: Guard against division by 0 and fall back to 25/1 framerate.
Original commit message from CVS: * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_process_ext_stream_props): Guard against division by 0 and fall back to 25/1 framerate.
This commit is contained in:
parent
5f2bca58b0
commit
229b4f33d3
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-04-01 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/asfdemux/gstasfdemux.c:
|
||||||
|
(gst_asf_demux_process_ext_stream_props):
|
||||||
|
Guard against division by 0 and fall back to 25/1 framerate.
|
||||||
|
|
||||||
2008-04-01 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-04-01 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_add_video_stream),
|
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_add_video_stream),
|
||||||
|
|
|
@ -2822,7 +2822,11 @@ done:
|
||||||
g_value_init (&framerate, GST_TYPE_FRACTION);
|
g_value_init (&framerate, GST_TYPE_FRACTION);
|
||||||
|
|
||||||
num = GST_SECOND / 100;
|
num = GST_SECOND / 100;
|
||||||
denom = esp.avg_time_per_frame;
|
denom = esp.avg_time_per_frame = 0;
|
||||||
|
if (denom == 0) {
|
||||||
|
/* avoid division by 0, assume 25/1 framerate */
|
||||||
|
denom = GST_SECOND / 2500;
|
||||||
|
}
|
||||||
|
|
||||||
gst_value_set_fraction (&framerate, num, denom);
|
gst_value_set_fraction (&framerate, num, denom);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue