diff src/image.c @ 83516:1321f6cfb389

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-266 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-267 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-268 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-269 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-270 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-271 Rename "field-at-point" to "field-at-pos" * emacs@sv.gnu.org/emacs--devo--0--patch-272 (comint-insert-input): Remove redundant calls to setq and goto-char git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-556
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 10 May 2006 15:04:01 +0000
parents 966a40e7fb54 7c25b386a4c3
children b6689e223e2f
line wrap: on
line diff
--- a/src/image.c	Fri May 05 10:30:28 2006 +0000
+++ b/src/image.c	Wed May 10 15:04:01 2006 +0000
@@ -2630,7 +2630,7 @@
 	  UNGCPRO;
 	  return 0;
 	}
-      path = cfstring_create_with_string (file);
+      path = cfstring_create_with_utf8_cstring (SDATA (file));
       url = CFURLCreateWithFileSystemPath (NULL, path,
 					   kCFURLPOSIXPathStyle, 0);
       CFRelease (path);
@@ -7901,6 +7901,8 @@
 #else  /* !HAVE_GIF */
 
 #ifdef MAC_OS
+static Lisp_Object Qduration;
+
 static int
 gif_load (f, img)
      struct frame *f;
@@ -7922,7 +7924,8 @@
   RGBColor bg_color;
   int width, height;
   XImagePtr ximg;
-  TimeValue time;
+  TimeScale time_scale;
+  TimeValue time, duration;
   int ino;
   CGrafPtr old_port;
   GDHandle old_gdh;
@@ -8030,6 +8033,7 @@
 		   image, img->spec);
       goto error;
     }
+  time_scale = GetMediaTimeScale (media);
 
   specified_bg = image_spec_value (img->spec, QCbackground, NULL);
   if (!STRINGP (specified_bg) ||
@@ -8055,7 +8059,7 @@
   SetGWorld (old_port, old_gdh);
   SetMovieActive (movie, 1);
   SetMovieGWorld (movie, ximg, NULL);
-  SampleNumToMediaTime (media, ino + 1, &time, NULL);
+  SampleNumToMediaTime (media, ino + 1, &time, &duration);
   SetMovieTimeValue (movie, time);
   MoviesTask (movie, 0L);
   DisposeTrackMedia (media);
@@ -8063,6 +8067,12 @@
   DisposeMovie (movie);
   if (dh)
     DisposeHandle (dh);
+
+  /* Save GIF image extension data for `image-extension-data'.
+     Format is (count IMAGES duration DURATION).  */
+  img->data.lisp_val = list4 (Qcount, make_number (nsamples), Qduration,
+			      make_float ((double)duration / time_scale));
+
   /* Maybe fill in the background field while we have ximg handy. */
   if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
     IMAGE_BACKGROUND (img, f, ximg);
@@ -8618,6 +8628,11 @@
   ADD_IMAGE_TYPE(Qgif);
 #endif
 
+#ifdef MAC_OS
+  Qduration = intern ("duration");
+  staticpro (&Qduration);
+#endif
+
 #if defined (HAVE_PNG) || defined (MAC_OS)
   Qpng = intern ("png");
   staticpro (&Qpng);