Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Feb 2008 16:31:46 GMT
From:      Felippe de Meirelles Motta <lippemail@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/121227: [UPDATE] multimedia/mmpython
Message-ID:  <200802291631.m1TGVklb084744@www.freebsd.org>
Resent-Message-ID: <200802291640.m1TGe10e055828@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         121227
>Category:       ports
>Synopsis:       [UPDATE] multimedia/mmpython
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 29 16:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Felippe de Meirelles Motta
>Release:        FreeBSD 7.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD 7.0-STABLE #1: Wed Feb 27 22:38:58 BRT 2008
    lippe@shire.freebsd.org:/usr/obj/usr/src/sys/GENERIC

>Description:
- Updated to 0.4.10
- Use SF macro
- Remove unnecessary patch and re-rolled present
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/multimedia/mmpython/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- Makefile	5 Apr 2007 06:03:22 -0000	1.19
+++ Makefile	29 Feb 2008 16:16:52 -0000
@@ -6,11 +6,9 @@
 #
 
 PORTNAME=	mmpython
-PORTVERSION=	0.4.8
-PORTREVISION=	2
+PORTVERSION=	0.4.10
 CATEGORIES=	multimedia python
-MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
-MASTER_SITE_SUBDIR=	${PORTNAME}
+MASTER_SITES=	SF
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	lewiz@compsoc.man.ac.uk
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/multimedia/mmpython/distinfo,v
retrieving revision 1.13
diff -u -r1.13 distinfo
--- distinfo	22 Jan 2006 21:19:39 -0000	1.13
+++ distinfo	29 Feb 2008 16:16:52 -0000
@@ -1,3 +1,3 @@
-MD5 (mmpython-0.4.8.tar.gz) = 0612629407e3e20b95eaff1e4ceebd65
-SHA256 (mmpython-0.4.8.tar.gz) = 5c73ce348c9d098961e0e776f359a5e6e9420432d24ac65b6cd670941381a418
-SIZE (mmpython-0.4.8.tar.gz) = 125245
+MD5 (mmpython-0.4.10.tar.gz) = 3a1f2e754308ac8cacd266c1350dcf34
+SHA256 (mmpython-0.4.10.tar.gz) = 1e46ef16c19aac6b0e3c335d6e3eed304874605a41b277869cea413d9a72f8ac
+SIZE (mmpython-0.4.10.tar.gz) = 128200
Index: files/patch-disc__discinfo.py
===================================================================
RCS file: files/patch-disc__discinfo.py
diff -N files/patch-disc__discinfo.py
--- files/patch-disc__discinfo.py	31 Mar 2006 01:58:03 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
---- disc/discinfo.py.orig	Sun Feb 26 15:51:41 2006
-+++ disc/discinfo.py	Sun Feb 26 15:51:44 2006
-@@ -139,8 +139,9 @@
-     # doesn't work. Suppress that warning for Linux users,
-     # until a better solution can be found.
-     if os.uname()[0] == 'FreeBSD':
--        CDIOREADTOCENTRYS = 0xc0086305L
-+        CDIOREADTOCENTRYS = -1073192187
-         CD_MSF_FORMAT = 2
-+        CDS_NO_DISC = 1
-         
-     try:
-         fd = os.open(device, os.O_RDONLY | os.O_NONBLOCK)
Index: files/patch-disc__lsdvd.py
===================================================================
RCS file: /home/ncvs/ports/multimedia/mmpython/files/patch-disc__lsdvd.py,v
retrieving revision 1.1
diff -u -r1.1 patch-disc__lsdvd.py
--- files/patch-disc__lsdvd.py	31 Mar 2006 01:58:03 -0000	1.1
+++ files/patch-disc__lsdvd.py	29 Feb 2008 16:16:52 -0000
@@ -1,11 +1,289 @@
---- disc/lsdvd.py.orig	Sun Feb 26 16:08:37 2006
-+++ disc/lsdvd.py	Sun Feb 26 16:32:03 2006
-@@ -96,7 +96,7 @@
-         self.mime = 'video/mpeg'
- 
-         l = data[3].split(':')
--        self.length   = (int(l[0])*60+int(l[1]))*60+int(l[2])
-+        self.length   = (int(l[0])*60+int(l[1]))*60+float(l[2])
-         self.trackno  = int(data[1])
-         self.chapters = int(data[5])
-         
+--- disc/lsdvd.py.old	1969-12-31 21:00:00.000000000 -0300
++++ disc/lsdvd.py	2006-09-26 10:18:52.000000000 -0300
+@@ -0,0 +1,286 @@
++# -----------------------------------------------------------------------
++# lsdvdinfo.py - parse dvd title structure
++# -----------------------------------------------------------------------
++# $Id: lsdvd.py 1906 2006-09-26 13:18:52Z duncan $
++#
++# Use lsdvd to get dvd informations.
++#
++# -----------------------------------------------------------------------
++# $Log: lsdvd.py,v $
++# Revision 1.13.2.1  2005/06/30 17:28:24  dischi
++# fix to new lsdvd
++#
++# Revision 1.13  2005/01/13 20:19:34  dischi
++# detect video_ts in lower case
++#
++# Revision 1.12  2004/08/27 17:27:44  dischi
++# do not import ifoparser
++#
++#
++# -----------------------------------------------------------------------
++# Copyright (C) 2003 Thomas Schueppel, Dirk Meyer
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
++# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program; if not, write to the Free Software Foundation, Inc.,
++# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++#
++# ----------------------------------------------------------------------- */
++
++
++import os
++import re
++from mmpython import mediainfo
++import mmpython
++from discinfo import DiscInfo
++
++LSDVD_EXE='lsdvd'
++
++class DVDAudio(mediainfo.AudioInfo):
++    def __init__(self, data):
++        mediainfo.AudioInfo.__init__(self)
++
++        self.rawdata = data
++
++        self.number = int(data[1])
++        try:
++            self.id = int(data[20],0)
++        except:
++            self.id = self.number
++
++        if data[3] != 'xx':
++            self.language = data[3]
++            self.languagedesc = data[5]
++            try:
++                # some DVDs have a very bad language setting
++                self.language.encode()
++            except UnicodeError:
++                self.language = ''
++            try:
++                self.languagedesc.encode()
++            except UnicodeError:
++                self.languagedesc = ''
++
++        try:
++            self.codec = data[7]
++            try:
++                self.samplerate = int(data[9])
++            except ValueError, e:
++                if data[9].lower().find('khz') > 0:
++                    pos = data[9].lower().find('khz')
++                    self.samplerate = int(data[9][:pos]) * 1000
++                else:
++                    raise e
++            self.channels = data[13]
++        except Exception, e:
++            # WTF, strange DVD, now try to find the bug (may not work)
++            self.codec = data[data.index('Format:') + 1]
++            try:
++                freq = data[data.index('Frequency:') + 1]
++                self.samplerate = int(freq)
++            except ValueError:
++                if freq.lower().find('khz') > 0:
++                    self.samplerate = int(freq[:freq.lower().find('khz')])*1000
++            self.channels = int(data[data.index('Channels:') + 1])
++
++
++class DVDSubtitle(mediainfo.SubtitleInfo):
++    def __init__(self, data):
++        mediainfo.SubtitleInfo.__init__(self)
++        self.rawdata = data
++        self.number = int(data[1])
++        try:
++            self.id = int(data[10],0)
++        except:
++            self.id = self.number
++        self.language = data[3]
++        try:
++            self.language.encode()
++        except UnicodeError:
++            self.language = ''
++        self.languagedesc = data[5]
++        try:
++            self.languagedesc.encode()
++        except UnicodeError:
++            self.languagedesc = ''
++        self.content = data[7]
++        try:
++            self.languagedesc.encode()
++        except UnicodeError:
++            self.languagedesc = ''
++
++    def __repr__(self):
++        if self.languagedesc != '':
++            return self.languagedesc
++        return self.language
++
++
++class DVDVideo(mediainfo.VideoInfo):
++    def __init__(self, data):
++        mediainfo.VideoInfo.__init__(self)
++        self.rawdata = data
++        self.width  = int(data[12])
++        self.height = int(data[14])
++        self.fps    = float(data[5])
++        self.aspect = data[10]
++
++
++class DVDTitle(mediainfo.AVInfo):
++    def __init__(self, data):
++        mediainfo.AVInfo.__init__(self)
++        self.rawdata = data
++        self.number = int(data[1])
++        self.keys.append('subtitles')
++        self.keys.append('chapters')
++        
++        self.mime = 'video/mpeg'
++
++        l = re.split('[:.]', data[3])
++        self.length   = (int(l[0])*60+int(l[1]))*60+int(l[2])
++        self.trackno  = int(data[1])
++        self.chapters = int(data[5])
++        
++            
++class DVDInfo(DiscInfo):
++    def __init__(self, device):
++        DiscInfo.__init__(self)
++        self.context = 'video'
++        self.offset = 0
++        if mediainfo.DEBUG > 1:
++            print 'trying lsdvd for scanning the disc'
++
++        if os.path.isdir(device):
++            self.valid = self.isDVDdir(device)
++        else:
++            self.valid = self.isDisc(device)
++
++        if self.valid and self.tracks:
++            self.keys.append('length')
++            self.length = 0
++            first       = 0
++
++            for t in self.tracks:
++                self.length += t.length
++                if not first:
++                    first = t.length
++            
++            if self.length/len(self.tracks) == first:
++                # badly mastered dvd
++                self.length = first
++
++            if mediainfo.DEBUG > 1:
++                print 'lsdvd detection ok'
++            
++        self.mime    = 'video/dvd'
++        self.type    = 'DVD'
++        self.subtype = 'video'
++
++
++    def lsdvd(self, path):
++        """
++        use lsdvd to get informations about this disc
++        """
++        import popen2
++        if mediainfo.DEBUG > 1:
++            print '%s -v -n -a -s "%s"' % (LSDVD_EXE, path)
++        child = popen2.Popen3('%s -v -n -a -s "%s"' % \
++                              (LSDVD_EXE, path), 1, 100)
++        for line in child.fromchild.readlines():
++            data = line.replace(',', '').replace('\t', '').\
++                   replace('\n', '').lstrip(' ').split(' ')
++            if mediainfo.DEBUG > 1:
++                print data
++            if len(data) > 2:
++                if data[0] == 'Title:':
++                    ti = DVDTitle(data)
++                    self.appendtrack(ti)
++                elif data[0] == 'Audio:':
++                    self.tracks[-1].audio.append(DVDAudio(data))
++                elif data[0] == 'Subtitle:':
++                    self.tracks[-1].subtitles.append(DVDSubtitle(data))
++                elif data[0] == 'VTS:':
++                    self.tracks[-1].video.append(DVDVideo(data))
++                    self.tracks[-1].video[-1].length = self.tracks[-1].length
++                elif data[:3] == ['Number', 'of', 'Angles:']:
++                    self.tracks[-1].angles = int(data[3])
++                    self.tracks[-1].keys.append('angles')
++                elif data[:2] == ['Longest', 'track:']:
++                    self.tracks[-1].longesttrack = int(data[2])
++                    self.tracks[-1].keys.append('longesttrack')
++                    
++        child.wait()
++        child.fromchild.close()
++        child.childerr.close()
++        child.tochild.close()
++
++        if len(self.tracks) > 0:
++            for ti in self.tracks:
++                ti.trackof = len(self.tracks)
++            return 1
++
++        return 0
++    
++            
++    def isDVDdir(self, dirname):
++        if os.path.isdir(dirname+'/VIDEO_TS') or \
++               os.path.isdir(dirname+'/video_ts') or \
++               os.path.isdir(dirname+'/Video_ts'):
++            return self.lsdvd(dirname)
++        return 0
++
++    
++    def isDisc(self, device):
++        if DiscInfo.isDisc(self, device) != 2:
++            return 0
++
++        # brute force reading of the device to find out if it is a DVD
++        f = open(device,'rb')
++        f.seek(32768, 0)
++        buffer = f.read(60000)
++
++        if buffer.find('UDF') == -1:
++            f.close()
++            return 0
++
++        # seems to be a DVD, read a little bit more
++        buffer += f.read(550000)
++        f.close()
++
++        if buffer.find('VIDEO_TS') == -1 and \
++               buffer.find('VIDEO_TS.IFO') == -1 and \
++               buffer.find('OSTA UDF Compliant') == -1:
++            return 0
++
++        ret = self.lsdvd(device)
++        if not ret:
++            # we are very sure this is a DVD, maybe the drive was not
++            # ready, let's try again
++            return self.lsdvd(device)
++        return 1
++
++
++if os.environ.has_key('LSDVD') and os.environ['LSDVD']:
++    LSDVD_EXE = os.environ['LSDVD']
++else:
++    for path in os.environ['PATH'].split(':'):
++        if os.path.isfile(os.path.join(path, 'lsdvd')):
++            LSDVD_EXE = os.path.join(path, 'lsdvd')
++            break
++    else:
++        if mediainfo.DEBUG:
++            print 'ImportError: lsdvd not found'
++        raise ImportError
++
++mmpython.registertype( 'video/dvd', mediainfo.EXTENSION_DEVICE,
++                       mediainfo.TYPE_AV, DVDInfo )
++mmpython.registertype( 'video/dvd', mediainfo.EXTENSION_DIRECTORY,
++                       mediainfo.TYPE_AV, DVDInfo )


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802291631.m1TGVklb084744>