summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2011-04-05 19:12:51 +0100
committerBastien Nocera <hadess@hadess.net>2011-04-05 19:30:16 +0100
commit9e8ca5f9175739a723401a45418bfa762571bbdd (patch)
treebf803614cc249652f415f4393ab49c308c1d90fe
parentc28f690c3b2df06a5f3c0ac499ec56490ca21f5a (diff)
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.
-rw-r--r--src/totem-video-thumbnailer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index cb235dd9..09a12171 100644
--- a/src/totem-video-thumbnailer.c
+++ b/src/totem-video-thumbnailer.c
@@ -607,7 +607,10 @@ create_gallery (BaconVideoWidget *bvw, const char *input, const char *output)
/* 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 (bvw, input, output, pos);
+ if (pos == stream_length)
+ screenshot = capture_frame_at_time (app, input, output, pos - 1);
+ else
+ screenshot = capture_frame_at_time (app, input, output, pos);
if (pixbuf == NULL) {
screenshot_width = gdk_pixbuf_get_width (screenshot);