[Player-cvs] mid/src media_service.py, 1.6, 1.6.4.1 toolbar_view.py, 1.13, 1.13.4.1
zhuao at helixcommunity.org zhuao at helixcommunity.orgUpdate of /cvsroot/player/mid/src
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv20389/src
Modified Files:
Tag: hxclient_3_4_1_atlas
media_service.py toolbar_view.py
Log Message:
Synopsis:
1. handle progress bar exception
2. skip DivX content during media import
3. add dbus-server exception handler
Overview:
1. handle progress bar exception
https://bugs.helixcommunity.org/show_bug.cgi?id=8360
when you plug a usb disk for a second time, there is some exception for media import.
"./realplayer-import:68: PangoWarning: pango_layout_get_line_count: assertion `layout != NULL' failed"
the reason is: since all media content has copied to device at the first time,
at the second time media import will update the progress bar in a high frequency,
lead to some exception from gdk.
I move the action of update progressbar to a real copy (new files found),
and also the progress bar update action is in "try: ...exception:..." to avoid this.
2. skip DivX content during media import
https://bugs.helixcommunity.org/show_bug.cgi?id=8281
analysis the mime type of avi content, if DivX streams, skip them.
3. add dbus-server exception handler
add some error handler for function call(GetMediaInfo()) to dbus-server.
Files Added:
No file added
Files Modified:
player/mid/import/realplayer-import
Synopsis:
Before drag (or click) progress bar call StartSeeking();
After drag (or click) progress bar call StopSeeking().
Overview:
fix bug #8258:
Click on the progress bar to change the play position is not acute
https://bugs.helixcommunity.org/show_bug.cgi?id=8258
we try to use StartSeeking()-->multi-SetPosition()-->StopSeeking() to replace
Pause()-->multi-SetPosition()-->Play() for seeking (drag the scroll bar or click
on the scroll bar).
Index: toolbar_view.py
===================================================================
RCS file: /cvsroot/player/mid/src/toolbar_view.py,v
retrieving revision 1.13
retrieving revision 1.13.4.1
diff -u -d -r1.13 -r1.13.4.1
--- toolbar_view.py 3 Jun 2008 10:51:16 -0000 1.13
+++ toolbar_view.py 5 Jun 2008 02:45:53 -0000 1.13.4.1
@@ -640,7 +640,7 @@
self.seekbar_drag_already = False
def sb_click_to_pause (self, widget, event):
- self.app.service.Pause()
+ self.app.service.StartSeeking()
def sb_click_to_change_video_playing_time (self, widget, event):
print 'video x=',event.x #used to get x coordinate of toobar
@@ -656,7 +656,7 @@
self.cur_pos = self.app.media_file_length
self.app.set_position(dbus.UInt32(self.cur_pos))
self.seekbar_click_already = False
- self.app.service.Play()
+ self.app.service.StopSeeking()
def sb_click_to_change_audio_playing_time (self, widget, event):
@@ -673,7 +673,7 @@
self.cur_pos = self.app.media_file_length
self.app.set_position(dbus.UInt32(self.cur_pos))
self.seekbar_click_already = False
- self.app.service.Play()
+ self.app.service.StopSeeking()
def calculate_pos (self, click_x_pos, x_min, x_max):
return self.app.media_file_length * ( (click_x_pos - x_min) / ( x_max - x_min) )
Index: media_service.py
===================================================================
RCS file: /cvsroot/player/mid/src/media_service.py,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -d -r1.6 -r1.6.4.1
--- media_service.py 4 Jun 2008 15:06:16 -0000 1.6
+++ media_service.py 5 Jun 2008 02:45:53 -0000 1.6.4.1
@@ -186,6 +186,22 @@
except dbus.exceptions.DBusException:
return self.__handle_service_exception()
+ def StartSeeking(self):
+ try:
+ if not self.__connected:
+ self.__connect_service()
+ return self.__player.StartSeeking()
+ except dbus.exceptions.DBusException:
+ return self.__handle_service_exception()
+
+ def StopSeeking(self):
+ try:
+ if not self.__connected:
+ self.__connect_service()
+ return self.__player.StopSeeking()
+ except dbus.exceptions.DBusException:
+ return self.__handle_service_exception()
+
def Status(self):
try:
if not self.__connected: