[longomatch] Retry taking snapshot 3 times
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Retry taking snapshot 3 times
- Date: Tue, 3 Feb 2015 15:08:53 +0000 (UTC)
commit 205cec4980df81f45417bea6387af820ef6c11d3
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Feb 3 16:07:10 2015 +0100
Retry taking snapshot 3 times
LongoMatch.Multimedia/Player/GstPlayer.cs | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Multimedia/Player/GstPlayer.cs b/LongoMatch.Multimedia/Player/GstPlayer.cs
index c01c699..68310f7 100644
--- a/LongoMatch.Multimedia/Player/GstPlayer.cs
+++ b/LongoMatch.Multimedia/Player/GstPlayer.cs
@@ -534,9 +534,18 @@ namespace LongoMatch.Video.Player
public Image GetFrame (Time pos, bool accurate, int outwidth=-1, int outheight=-1)
{
+ Image img = null;
+
Seek (pos, accurate, false);
Pause ();
- return GetCurrentFrame (outwidth, outheight);
+ for (int i=0; i < 3; i++) {
+ img = GetCurrentFrame (outwidth, outheight);
+ if (img != null) {
+ break;
+ }
+ System.Threading.Thread.Sleep (10);
+ }
+ return img;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]