Fix for bug #1387286, playing audio CD clips on windows

Fixes: https://launchpad.net/bugs/1387286
This commit is contained in:
Tomas Groth 2014-10-31 22:44:22 +00:00
parent 74b582032f
commit 6500a4b813
2 changed files with 3 additions and 1 deletions

View File

@ -167,6 +167,8 @@ class VlcPlayer(MediaPlayer):
path = os.path.normcase(file_path)
# create the media
if controller.media_info.media_type == MediaType.CD:
if is_win():
path = '/' + path
display.vlc_media = display.vlc_instance.media_new_location('cdda://' + path)
display.vlc_media_player.set_media(display.vlc_media)
display.vlc_media_player.play()

View File

@ -219,7 +219,7 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector, RegistryPropert
return
# VLC behaves a bit differently on windows and linux when loading, which creates problems when trying to
# detect if we're dealing with a DVD or CD, so we use different loading approaches depending on the OS.
if os.name == 'nt':
if is_win():
# If the given path is in the format "D:\" or "D:", prefix it with "/" to make VLC happy
pattern = re.compile('^\w:\\\\*$')
if pattern.match(path):