[pitivi] timeline/track.py: use different priority computation for audio/video stream types
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] timeline/track.py: use different priority computation for audio/video stream types
- Date: Tue, 16 Mar 2010 18:09:44 +0000 (UTC)
commit eff00261357b02f978d5948b138e095b3c32e8db
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Wed Mar 10 01:22:57 2010 -0800
timeline/track.py: use different priority computation for audio/video stream
types
pitivi/timeline/track.py | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index fa4a5d7..49f4678 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -311,6 +311,7 @@ class TrackObject(Signallable, Loggable):
self.debug("factory:%r", factory)
self.factory = factory
self.stream = stream
+ self.stream_type = type(stream)
self.track = None
self.timeline_object = None
self.interpolators = {}
@@ -519,7 +520,10 @@ class TrackObject(Signallable, Loggable):
self._updatePriority(priority)
def _updatePriority(self, priority):
- true_priority = 2 + self._stagger + (3 * priority)
+ if self.stream_type is VideoStream:
+ true_priority = 2 + self._stagger + (3 * priority)
+ elif self.stream_type is AudioStream:
+ true_priority = 2 + (2 * self._stagger) + (4 * priority)
if self.gnl_object.props.priority != true_priority:
self.gnl_object.props.priority = true_priority
@@ -631,8 +635,12 @@ class TrackObject(Signallable, Loggable):
i.updateMediaStop(stop)
def _notifyPriorityCb(self, obj, pspec):
- true_priority = obj.props.priority
- public_priority = (true_priority - 2 - self._stagger) // 3
+ if self.stream_type is VideoStream:
+ true_priority = obj.props.priority
+ public_priority = (true_priority - 2 - self._stagger) // 3
+ elif self.stream_type is AudioStream:
+ true_priority = obj.props.priority
+ public_priority = (true_priority - 2 - (2 * self._stagger))// 4
if self._public_priority != public_priority:
self._public_priority = public_priority
self.emit('priority-changed', public_priority)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]