[poppler] 3 commits - glib/poppler-movie.cc glib/reference

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 21 19:52:07 UTC 2019


 glib/poppler-movie.cc               |   21 ++++++++++++---------
 glib/reference/poppler-sections.txt |    1 -
 2 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit e47daf60cfbbbf1b1501b32a80e5625e51be8eae
Author: Evgeny Stambulchik <fnevgeny at gmail.com>
Date:   Wed Aug 21 21:57:14 2019 +0300

    Make sure guint64 is not overflown

diff --git a/glib/poppler-movie.cc b/glib/poppler-movie.cc
index f8e6e7ec..14b75e06 100644
--- a/glib/poppler-movie.cc
+++ b/glib/poppler-movie.cc
@@ -118,17 +118,19 @@ _poppler_movie_new (const Movie *poppler_movie)
 
   movie->rate = poppler_movie->getActivationParameters()->rate;
 
-  if (poppler_movie->getActivationParameters()->start.units_per_second > 0) {
-    movie->start = 1000000000L*
-      poppler_movie->getActivationParameters()->start.units/
+  if (poppler_movie->getActivationParameters()->start.units_per_second > 0 &&
+      poppler_movie->getActivationParameters()->start.units <= G_MAXUINT64 / 1000000000) {
+    movie->start = 1000000000L *
+      poppler_movie->getActivationParameters()->start.units /
       poppler_movie->getActivationParameters()->start.units_per_second;
   } else {
     movie->start = 0L;
   }
 
-  if (poppler_movie->getActivationParameters()->duration.units_per_second > 0) {
-    movie->duration = 1000000000L*
-      poppler_movie->getActivationParameters()->duration.units/
+  if (poppler_movie->getActivationParameters()->duration.units_per_second > 0 &&
+      poppler_movie->getActivationParameters()->duration.units <= G_MAXUINT64 / 1000000000) {
+    movie->duration = 1000000000L *
+      poppler_movie->getActivationParameters()->duration.units /
       poppler_movie->getActivationParameters()->duration.units_per_second;
   } else {
     movie->duration = 0L;
commit 7866954b44b7c333b875e3cf5e4865802682e2d2
Author: Evgeny Stambulchik <fnevgeny at gmail.com>
Date:   Wed Aug 21 20:55:13 2019 +0300

    Store PopplerMovie.volume as double, mapped to 0 - 1

diff --git a/glib/poppler-movie.cc b/glib/poppler-movie.cc
index aa40aa15..f8e6e7ec 100644
--- a/glib/poppler-movie.cc
+++ b/glib/poppler-movie.cc
@@ -39,7 +39,7 @@ struct _PopplerMovie
   gboolean show_controls;
   PopplerMoviePlayMode mode;
   gboolean synchronous_play;
-  gint     volume;
+  gdouble  volume;
   gdouble  rate;
   guint64  start;
   guint64  duration;
@@ -113,7 +113,8 @@ _poppler_movie_new (const Movie *poppler_movie)
 
   movie->synchronous_play = poppler_movie->getActivationParameters()->synchronousPlay;
 
-  movie->volume = poppler_movie->getActivationParameters()->volume;
+  // map 0 - 100 to 0.0 - 1.0
+  movie->volume = poppler_movie->getActivationParameters()->volume / 100.0;
 
   movie->rate = poppler_movie->getActivationParameters()->rate;
 
@@ -247,7 +248,7 @@ poppler_movie_get_volume (PopplerMovie *poppler_movie)
 {
   g_return_val_if_fail (POPPLER_IS_MOVIE (poppler_movie), 0);
 
-  return poppler_movie->volume/100.0;
+  return poppler_movie->volume;
 }
 
 /**
commit 52f70051f652de2ec1e1f8e83fbc090a7c9d0603
Author: Evgeny Stambulchik <fnevgeny at gmail.com>
Date:   Wed Aug 21 20:51:10 2019 +0300

    PopplerMovieTime no longer used

diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt
index 49fe3b72..66c57f2b 100644
--- a/glib/reference/poppler-sections.txt
+++ b/glib/reference/poppler-sections.txt
@@ -583,7 +583,6 @@ poppler_media_get_type
 <TITLE>Poppler Movie</TITLE>
 PopplerMovie
 PopplerMoviePlayMode
-PopplerMovieTime
 poppler_movie_get_duration
 poppler_movie_get_filename
 poppler_movie_get_play_mode


More information about the poppler mailing list