[totem] thumbnailer: Fix gallery mode's last picture



commit b86fccb8be192ddb857fa694918776b602d02a31
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Apr 5 19:12:51 2011 +0100

    thumbnailer: Fix gallery mode's last picture
    
    We were trying to get the last picture at the same offset
    as the file duration. Seek would have failed there, and
    we wouldn't be able to get a frame.

 src/totem-video-thumbnailer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index 2fa8805..3e00da7 100644
--- a/src/totem-video-thumbnailer.c
+++ b/src/totem-video-thumbnailer.c
@@ -686,7 +686,10 @@ create_gallery (ThumbApp *app)
 	/* Take the screenshots and composite them into a pixbuf */
 	current_column = current_row = x = y = 0;
 	for (pos = screenshot_interval; pos <= stream_length; pos += screenshot_interval) {
-		screenshot = capture_frame_at_time (app, pos);
+		if (pos == stream_length)
+			screenshot = capture_frame_at_time (app, pos - 1);
+		else
+			screenshot = capture_frame_at_time (app, pos);
 
 		if (pixbuf == NULL) {
 			screenshot_width = gdk_pixbuf_get_width (screenshot);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]