Merge lp:~vikoadi/audience/gstreamer-install into lp:~audience-members/audience/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: Cody Garver
Approved revision: 553
Merged at revision: 558
Proposed branch: lp:~vikoadi/audience/gstreamer-install
Merge into: lp:~audience-members/audience/trunk
Diff against target: 97 lines (+15/-28)
2 files modified
src/Widgets/BottomBar.vala (+1/-1)
src/Widgets/VideoPlayer.vala (+14/-27)
To merge this branch: bzr merge lp:~vikoadi/audience/gstreamer-install
Reviewer Review Type Date Requested Status
Audience Members Pending
Review via email: mp+276850@code.launchpad.net

Commit message

- use EOS message (fix Bug #1461680)
- check video size after codec check (fix Bug #1409290)

Description of the change

- dont use about_to_finish and Gst.Bus.peek, use EOS message instead
- get video size after codec check not before, dont emit error if getting video size fail

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/BottomBar.vala'
2--- src/Widgets/BottomBar.vala 2015-06-14 07:02:09 +0000
3+++ src/Widgets/BottomBar.vala 2015-11-06 10:25:14 +0000
4@@ -132,7 +132,7 @@
5 } else {
6 play_button.image = new Gtk.Image.from_icon_name ("media-playback-start-symbolic", Gtk.IconSize.BUTTON);
7 play_button.tooltip_text = _("Play");
8- set_reveal_child (!player.at_end);
9+ set_reveal_child (true);
10 }
11 }
12
13
14=== modified file 'src/Widgets/VideoPlayer.vala'
15--- src/Widgets/VideoPlayer.vala 2015-09-21 18:11:20 +0000
16+++ src/Widgets/VideoPlayer.vala 2015-11-06 10:25:14 +0000
17@@ -47,7 +47,6 @@
18
19 namespace Audience.Widgets {
20 public class VideoPlayer : Actor {
21- public bool at_end;
22
23 bool _playing;
24 public bool playing {
25@@ -99,6 +98,19 @@
26 if (value == (string)playbin.uri)
27 return;
28
29+ playbin.get_bus ().set_flushing (true);
30+ playing = false;
31+ playbin.set_state (Gst.State.READY);
32+ playbin.suburi = null;
33+ subtitle_uri = null;
34+ playbin.get_bus ().set_flushing (false);
35+ playbin.uri = value;
36+ volume = 1.0;
37+
38+ relayout ();
39+ playing = false;
40+
41+ // this has to be done after setting uri playbin, if not codec checking will fail
42 try {
43 var info = new Gst.PbUtils.Discoverer (10 * Gst.SECOND).discover_uri (value);
44 var video = info.get_video_streams ();
45@@ -110,23 +122,9 @@
46 video_height = h;
47 }
48 } catch (Error e) {
49- error ();
50 warning (e.message);
51 return;
52 }
53-
54- playbin.get_bus ().set_flushing (true);
55- playing = false;
56- playbin.set_state (Gst.State.READY);
57- playbin.suburi = null;
58- subtitle_uri = null;
59- playbin.get_bus ().set_flushing (false);
60- playbin.uri = value;
61- volume = 1.0;
62- at_end = false;
63-
64- relayout ();
65- playing = false;
66 }
67 }
68
69@@ -243,19 +241,9 @@
70 settings.changed.connect (() => {
71 update_subtitle_font ();
72 });
73-
74- playbin.about_to_finish.connect (() => {
75- if (!at_end) {
76- at_end = true;
77- ended ();
78- }
79- });
80 }
81
82- void watch () {
83- var msg = playbin.get_bus ().peek ();
84- if (msg == null)
85- return;
86+ void watch (Gst.Message msg) {
87
88 switch (msg.type) {
89 case Gst.MessageType.APPLICATION:
90@@ -277,7 +265,6 @@
91 break;
92 case Gst.MessageType.EOS:
93 Idle.add (()=>{
94- playbin.set_state (Gst.State.READY);
95 ended ();
96 return false;
97 });

Subscribers

People subscribed via source and target branches