
video thumbs idea
Various KDE 1.-4. Improvements
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
Hi everyone ! I have a lot of video on my hard drive and I have i think there is a problem with the video thumbs. I think it should be better to take an random frame in the film like in nautilus. The tumbs are useless in konqueror because most of time, the first frame is just black.
Just see the screenshot. I love konqueror so i think it should be better like that. Sorry for my bad english !
thank you :)
Shahid
13 years ago
diff -purN xine-thumbnail/thumbnail/videocreator.cpp xine-thumbnail.new/thumbnail/videocreator.cpp
--- xine-thumbnail/thumbnail/videocreator.cpp 2006-05-30 18:18:51.000000000 +0400
+++ xine-thumbnail.new/thumbnail/videocreator.cpp 2007-06-26 15:54:06.000000000 +0400
@@ -32,11 +32,13 @@
#include <qimage.h>
#include <qpainter.h>
#include <qpaintdevice.h>
+#include <qdatetime.h>
#include <iostream>
#include <kstandarddirs.h>
#include <kapplication.h>
+#include <krandomsequence.h>
#define XINE_ENABLE_EXPERIMENTAL_FEATURES 1
@@ -260,13 +262,18 @@ bool VideoCreator::create(const QString
int length;
bool canPlay = false;
- /* For streams for which length info is available seek to 1/3 file
+ /* For streams for which length info is available seek from 1/6 to 5/6 file
* or else play for the first 5-10 seconds and get the frame */
-
- if ( ((!xine_get_pos_length( stream, NULL, NULL, &length )) && xine_play( stream, 0, 5000 )) ||
- xine_play (stream, 21845, 0))
+ KRandomSequence* rand = new KRandomSequence(QDateTime::currentDateTime().toTime_t());
+ unsigned long rand_frame = rand -> getLong (45535) + 10000;
+ unsigned long rand_msec = rand -> getLong (5000) + 5000;
+
+ if ( ((!xine_get_pos_length( stream, NULL, NULL, &length )) && xine_play( stream, 0, rand_msec )) ||
+ xine_play (stream, rand_frame, 0))
canPlay = true;
-
+
+ // Destructor of KRandomSequence
+ rand -> ~KRandomSequence();
bool hasVideo = xine_get_stream_info (stream, XINE_STREAM_INFO_HAS_VIDEO);
bool videoHandled = xine_get_stream_info (stream, XINE_STREAM_INFO_VIDEO_HANDLED);
Report
RockMan81
14 years ago
Check it (it's here in kde-apps.org, too)
Report
Ekardnam
14 years ago
Yes, I'm using Konqueror (3.5.2)
Report
ktulu77
14 years ago
Report
ktulu77
14 years ago
thank you very much !
why have we to wait kde 4 for this so small patch ? it is too bad.
Report
Superstoned
14 years ago
Report
ktulu77
14 years ago
Report
campusloop
14 years ago
If anybody wants it please suggest a site/place where i can upload the tarball.
Report
abhay
14 years ago
Report
campusloop
14 years ago
Report