Update of /cvsroot/freevo/freevo/src/video In directory sc8-pr-cvs1:/tmp/cvs-serv3466
Modified Files: __init__.py fxdhandler.py videoitem.py Log Message: patch from Matthieu Weber Index: __init__.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/video/__init__.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** __init__.py 6 Dec 2003 13:44:11 -0000 1.18 --- __init__.py 9 Dec 2003 19:43:01 -0000 1.19 *************** *** 10,13 **** --- 10,16 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.19 2003/12/09 19:43:01 dischi + # patch from Matthieu Weber + # # Revision 1.18 2003/12/06 13:44:11 dischi # move more info to the Mimetype *************** *** 162,168 **** diritem.xml_file = tvinfo[3] - - - def hash_fxd_movie_database(): """ --- 165,168 ---- *************** *** 218,221 **** --- 218,223 ---- tv_show_informations[k] = (info.image, info.info, info.mplayer_options, info.xml_file) + for fo in info.files_options: + discset_informations[fo['file-id']] = fo['mplayer-options'] _debug_('done',1) Index: fxdhandler.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/video/fxdhandler.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fxdhandler.py 7 Dec 2003 12:28:25 -0000 1.5 --- fxdhandler.py 9 Dec 2003 19:43:01 -0000 1.6 *************** *** 10,13 **** --- 10,16 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.6 2003/12/09 19:43:01 dischi + # patch from Matthieu Weber + # # Revision 1.5 2003/12/07 12:28:25 dischi # bugfix *************** *** 73,80 **** """ filename = fxd.gettext(node) mode = node.name id = fxd.getattr(node, 'id') ! media_id = fxd.getattr(node, 'media_id') ! options = fxd.getattr(node, 'mplayer_options') player = fxd.childcontent(node, 'player') playlist = False --- 76,85 ---- """ filename = fxd.gettext(node) + media_id = fxd.getattr(node, 'media-id') + if media_id == '': + filename = vfs.join(dirname, filename) mode = node.name id = fxd.getattr(node, 'id') ! options = fxd.getattr(node, 'mplayer-options') player = fxd.childcontent(node, 'player') playlist = False *************** *** 132,150 **** for variant in variants: ! audio = fxd.get_children(variant, 'audio') ! subtitle = fxd.get_children(variant, 'subtitle') ! ! if audio: ! audio = { 'media_id': fxd.getattr(audio[0], 'media_id'), ! 'file' : fxd.gettext(audio[0]) } ! else: ! audio = {} ! ! if subtitle: ! subtitle = { 'media_id': fxd.getattr(subtitle[0], 'media_id'), ! 'file' : fxd.gettext(subtitle[0]) } ! else: ! subtitle = {} ! parts = fxd.get_children(variant, 'part') if len(parts) == 1: --- 137,141 ---- for variant in variants: ! mplayer_options += " " + fxd.getattr(variant, 'mplayer-options'); parts = fxd.get_children(variant, 'part') if len(parts) == 1: *************** *** 158,164 **** v.is_playlist = True ! v.subtitle_file = subtitle v.audio_file = audio # global <video> mplayer_options if mplayer_options: --- 149,172 ---- v.is_playlist = True ! audio = fxd.get_children(parts[0], 'audio') ! if audio: ! audio = { 'media_id': fxd.getattr(audio[0], 'media-id'), ! 'file' : fxd.gettext(audio[0]) } ! if audio['media_id'] == '': ! audio['file'] = vfs.join(dirname, audio['file']) ! else: ! audio = {} v.audio_file = audio + subtitle = fxd.get_children(parts[0], 'subtitle') + if subtitle: + subtitle = { 'media_id': fxd.getattr(subtitle[0], 'media-id'), + 'file' : fxd.gettext(subtitle[0]) } + if subtitle['media_id'] == '': + subtitle['file'] = vfs.join(dirname, subtitle['file']) + else: + subtitle = {} + v.subtitle_file = subtitle + # global <video> mplayer_options if mplayer_options: *************** *** 167,181 **** # a variant with a list of files v = VideoItem('', parent=item, parse=False) - v.subtitle_file = subtitle - v.audio_file = audio for p in parts: ref = fxd.getattr(p ,'ref') sub = VideoItem(id[ref][1], parent=v, parse=False) ! sub.mode, sub.media_id, sub.mplayer_options = id[ref][2:] # global <video> mplayer_options if mplayer_options: sub.mplayer_options += mplayer_options v.subitems.append(sub) ! v.name = fxd.getattr(variant, 'name') item.variants.append(v) --- 175,208 ---- # a variant with a list of files v = VideoItem('', parent=item, parse=False) for p in parts: ref = fxd.getattr(p ,'ref') + audio = fxd.get_children(p, 'audio') + subtitle = fxd.get_children(p, 'subtitle') + + if audio: + audio = { 'media_id': fxd.getattr(audio[0], 'media-id'), + 'file' : fxd.gettext(audio[0]) } + if audio['media_id'] == '': + audio['file'] = vfs.join(dirname, audio['file']) + else: + audio = {} + + if subtitle: + subtitle = { 'media_id': fxd.getattr(subtitle[0], 'media-id'), + 'file' : fxd.gettext(subtitle[0]) } + if subtitle['media_id'] == '': + subtitle['file'] = vfs.join(dirname, subtitle['file']) + else: + subtitle = {} + sub = VideoItem(id[ref][1], parent=v, parse=False) ! sub.mode, sub.media_id, sub.mplayer_options, player, is_playlist = id[ref][2:] ! sub.subtitle_file = subtitle ! sub.audio_file = audio # global <video> mplayer_options if mplayer_options: sub.mplayer_options += mplayer_options v.subitems.append(sub) ! v.name = fxd.getattr(variant, 'name') item.variants.append(v) *************** *** 199,203 **** info = parse_video_child(fxd, s, item, dirname) v = VideoItem(info[1], parent=item, parse=False) ! v.mode, v.media_id, v.mplayer_options = info[2:] if info[-2]: v.force_player = info[-2] --- 226,230 ---- info = parse_video_child(fxd, s, item, dirname) v = VideoItem(info[1], parent=item, parse=False) ! v.mode, v.media_id, v.mplayer_options, player, is_playlist = info[2:] if info[-2]: v.force_player = info[-2] *************** *** 208,212 **** v.mplayer_options += mplayer_options item.subitems.append(v) ! item.xml_file = fxd_file fxd.getattr(None, 'items', []).append(item) --- 235,239 ---- v.mplayer_options += mplayer_options item.subitems.append(v) ! item.xml_file = fxd_file fxd.getattr(None, 'items', []).append(item) *************** *** 215,219 **** ! def parse_disc_set(fxd, node): """ --- 242,246 ---- ! def parse_disc_set(fxd, node): """ *************** *** 245,254 **** # what to do with the mplayer_options? We can't use them for # one disc, or can we? And file_ops? Also only on a per disc base. # So I ignore that we are in a disc right now and use the 'item' ! item.mplayer_options = fxd.getattr(disc, 'mplayer_options') ! for f in fxd.get_children(disc, 'file-opts'): ! opt = { 'file-d': f.getattr(f, 'media-id'), ! 'mplayer_options': f.getattr(f, 'mplayer_options') } item.files_options.append(opt) item.xml_file = fxd_file fxd.getattr(None, 'items', []).append(item) --- 272,296 ---- # what to do with the mplayer_options? We can't use them for # one disc, or can we? And file_ops? Also only on a per disc base. + # Answer: it applies to all the files of the disc, unless there + # are <file-opt> which specify to what files the + # mplayer_options apply. <file-opt> is not such a good + # name, though. # So I ignore that we are in a disc right now and use the 'item' ! item.mplayer_options = fxd.getattr(disc, 'mplayer-options') ! there_are_file_opts = 0 ! for f in fxd.get_children(disc, 'file-opt'): ! there_are_file_opts = 1 ! file_media_id = fxd.getattr(f, 'media-id') ! if not file_media_id: ! file_media_id = id ! mpl_opts = item.mplayer_options + ' ' + fxd.getattr(f, 'mplayer-options') ! opt = { 'file-id' : file_media_id + fxd.gettext(f), ! 'mplayer-options': mpl_opts } item.files_options.append(opt) + if there_are_file_opts: + # in this case, the disc/@mplayer_options is retricted to the set + # of files defined in the file-opt elements + item.mplayer_options = '' + item.xml_file = fxd_file fxd.getattr(None, 'items', []).append(item) Index: videoitem.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/video/videoitem.py,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** videoitem.py 6 Dec 2003 16:25:45 -0000 1.100 --- videoitem.py 9 Dec 2003 19:43:01 -0000 1.101 *************** *** 11,14 **** --- 11,17 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.101 2003/12/09 19:43:01 dischi + # patch from Matthieu Weber + # # Revision 1.100 2003/12/06 16:25:45 dischi # support for type=url and <playlist> and <player> *************** *** 122,126 **** self.subtitle_file = {} # text subtitles ! self.audio_file = {} # audio dubbing self.item_id = None --- 125,129 ---- self.subtitle_file = {} # text subtitles ! self.audio_file = {} # audio dubbing self.item_id = None *************** *** 143,146 **** --- 146,152 ---- self.possible_player = [] + self.file_id = '' + if parent and parent.media: + self.file_id = parent.media.id + filename[len(os.path.join(parent.media.mountdir,"")):] self.filename = filename *************** *** 149,152 **** --- 155,159 ---- if not self.name: self.name = util.getname(filename) + # find image for tv show and build new title *************** *** 171,174 **** --- 178,184 ---- self.xml_file = tvinfo[3] self.mplayer_options = tvinfo[2] + from video import discset_informations + if discset_informations.has_key(self.file_id): + self.mplayer_options = discset_informations[self.file_id] self.tv_show = True *************** *** 456,473 **** if not mplayer_options: mplayer_options = "" - - if self.subtitle_file: - d, f = util.resolve_media_mountdir(self.subtitle_file['media-id'], - self.subtitle_file['file']) - if d: - util.mount(d) - mplayer_options += ' -sub "%s"' % f - - if self.audio_file: - d, f = util.resolve_media_mountdir(self.audio_file['media-id'], - self.audio_file['file']) - if d: - util.mount(d) - mplayer_options += ' -audiofile "%s"' % f if arg: --- 466,469 ---- ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Freevo-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog