Merge lp:~darkcs2/audience/fix-1163909 into lp:~audience-members/audience/trunk

Proposed by Dark_Cs on 2013-04-15
Status: Merged
Merged at revision: 382
Proposed branch: lp:~darkcs2/audience/fix-1163909
Merge into: lp:~audience-members/audience/trunk
Diff against target: 63 lines (+36/-4)
2 files modified
Audience/Audience.vala (+15/-4)
Audience/Widgets/VideoPlayer.vala (+21/-0)
To merge this branch: bzr merge lp:~darkcs2/audience/fix-1163909
Reviewer Review Type Date Requested Status
Cody Garver 2013-04-15 Approve on 2014-08-30
Review via email: mp+158975@code.launchpad.net
To post a comment you must log in.
Cody Garver (codygarver) wrote :

Split up the fixes 1 branch per fix.

I disapprove the window title changes because we intentionally replace dots and underscores and the like with spaces.

review: Needs Fixing
Cody Garver (codygarver) wrote :

And the typo has already been fixed in trunk it's just stuck updating for some reason.

Volodymyr Shatsky (shockone89) wrote :

I would also like to discuss the distance of jumps. Usually I want to rewind when I missed something, so 60 seconds are too long and 3 are too short. I suggest to make asymmetric jumps — 10 and 30 seconds for back and forth accordingly.

The solution I always dreamed about is to rewind to the beginning of the current scene, how hard is it to implement?

lp:~darkcs2/audience/fix-1163909 updated on 2013-04-15
262. By Dark_Cs on 2013-04-15

fix: time jumps with arrows (3 seconds / 60 with Ctrl)

Cody Garver (codygarver) wrote :

I don't think scene detection is feasible because it's CPU intensive and would add loading time before a video can start playing. We should see what the other video players out there are using for skip time.

Dark_Cs (darkcs2) wrote :

For example, PotPlayer uses 5 seconds for a short jump and 30 with Ctrl. The KMPlayer uses the same settings. I think that this property should be configurable by user.

p.s. What IDE do you use to development and debug? It is difficult to test the program without debugging.

Cody Garver (codygarver) wrote :

Merged a slightly modified version of this at revision 382

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Audience/Audience.vala'
2--- Audience/Audience.vala 2013-04-13 20:13:03 +0000
3+++ Audience/Audience.vala 2013-04-15 17:37:26 +0000
4@@ -242,13 +242,24 @@
5 mainwindow.destroy ();
6 break;
7 case Gdk.Key.Left:
8- if ((video_player.progress - 0.05) < 0)
9- video_player.progress = 0.0;
10+ if ((e.state & Gdk.ModifierType.CONTROL_MASK) != Gdk.ModifierType.CONTROL_MASK)
11+ {
12+ video_player.rewind_seconds (-3);
13+ }
14 else
15- video_player.progress -= 0.05;
16+ {
17+ video_player.rewind_seconds (-60);
18+ }
19 break;
20 case Gdk.Key.Right:
21- video_player.progress += 0.05;
22+ if ((e.state & Gdk.ModifierType.CONTROL_MASK) != Gdk.ModifierType.CONTROL_MASK)
23+ {
24+ video_player.rewind_seconds (3);
25+ }
26+ else
27+ {
28+ video_player.rewind_seconds (60);
29+ }
30 break;
31 case Gdk.Key.a:
32 next_audio ();
33
34=== modified file 'Audience/Widgets/VideoPlayer.vala'
35--- Audience/Widgets/VideoPlayer.vala 2013-04-07 18:53:17 +0000
36+++ Audience/Widgets/VideoPlayer.vala 2013-04-15 17:37:26 +0000
37@@ -624,5 +624,26 @@
38 dpy.get_screensaver (out timeout, out interval, out prefer_blanking, out allow_exposures);
39 dpy.set_screensaver (enable ? timeout : 0, interval, prefer_blanking, allow_exposures);
40 }
41+
42+ public void rewind_seconds (int seconds)
43+ {
44+ int64 gstSecond = 1000000000;
45+ int64 position, length;
46+ var time = Gst.Format.TIME;
47+#if HAS_CLUTTER_GST_1
48+ playbin.query_duration (Gst.Format.TIME, out length);
49+ playbin.query_position (Gst.Format.TIME, out position);
50+#else
51+ playbin.query_duration (ref time, out length);
52+ playbin.query_position (ref time, out position);
53+#endif
54+ if ((position + seconds * gstSecond) < 0)
55+ {
56+ playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, 1);
57+ return;
58+ }
59+
60+ playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, (int64)(position + seconds * gstSecond));
61+ }
62 }
63 }

Subscribers

People subscribed via source and target branches

to all changes: