[tracker/tracker-0.10] tracker-extract-gstreamer: Fix division by zero
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] tracker-extract-gstreamer: Fix division by zero
- Date: Thu, 6 Oct 2011 16:44:01 +0000 (UTC)
commit 0d48b2ae8ee8b298ef272dfb03fe6b7a27ad79f7
Author: JÃrg Billeter <j bitron ch>
Date: Tue Sep 27 16:57:47 2011 +0200
tracker-extract-gstreamer: Fix division by zero
src/tracker-extract/tracker-extract-gstreamer.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index b25b738..0e00d44 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -1037,12 +1037,16 @@ discoverer_init_and_run (MetadataExtractor *extractor,
extractor->has_image = TRUE;
} else {
extractor->has_video = TRUE;
- extractor->video_fps = (gfloat)(gst_discoverer_video_info_get_framerate_num (video) /
- gst_discoverer_video_info_get_framerate_denom (video));
+ if (gst_discoverer_video_info_get_framerate_denom (video) > 0) {
+ extractor->video_fps = (gfloat)(gst_discoverer_video_info_get_framerate_num (video) /
+ gst_discoverer_video_info_get_framerate_denom (video));
+ }
extractor->width = gst_discoverer_video_info_get_width (video);
extractor->height = gst_discoverer_video_info_get_height (video);
- extractor->aspect_ratio = (gfloat)(gst_discoverer_video_info_get_par_num (video) /
- gst_discoverer_video_info_get_par_denom (video));
+ if (gst_discoverer_video_info_get_par_denom (video) > 0) {
+ extractor->aspect_ratio = (gfloat)(gst_discoverer_video_info_get_par_num (video) /
+ gst_discoverer_video_info_get_par_denom (video));
+ }
}
} else {
/* Unknown type - do nothing */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]