Justin T Wetherell wrote:
> The only thing dvdinfo.py did for me was stopping Freevo from
> crashing. I still cannot play DVD's even if I select a file from the
> DVD directory. I don't know if that was the purpose or not. I have
> three Freevos with all different video output's and non of them
> work. I can play DVD's thru mplayer outside of Freevo though.

Yea, that's because I call mplayer with dvd://1000 and only the
lastest version supports values greater 99. Attached is a new version
of the patch, please let me know if it works.

Sinec you had the old patch installed, mmpython cached the wrong info
(no dvd). So you need to remove the wrong discs in
/var/cache/freevo/mmpython/disc to force mmpython to recache.

>
> Matthew Carpenter wrote:
>
>>Dirk Meyer submitted a replacement "dvdinfo.py" and asked for input.  I have seen no 
>>response to this so here is mine:
>>
>>gandalf:~ # freevo
>>MOVIE_DATA_DIR not found
>>ROM_DRIVES: Auto-detected and added "('/media/cdrecorder', '/dev/cdrecorder', 
>>'CDREC-1')"
>>ROM_DRIVES: Auto-detected that /dev/cdrom is the same device as /dev/cdrecorder, 
>>skipping
>>ROM_DRIVES: Auto-detected and added "('/media/dvd', '/dev/dvd', 'DVD-2')"
>>WARNING: /etc/freevo/lircrc not found!
>>open1
>>Pygame Parachute Traceback:
>>Thread-0x80194958
>>  File "/usr/local/freevo/runtime/lib/python2.3/threading.py", line 204, in wait
>>Thread-0x8019dc70
>>  File "/usr/local/freevo/runtime/lib/python2.3/threading.py", line 204, in wait
>>Thread-0x80278208
>>  File "/usr/local/freevo/runtime/lib/python2.3/threading.py", line 204, in wait
>>Thread-0x801baee0
>>  File "/usr/local/freevo/runtime/lib/python2.3/threading.py", line 204, in wait
>>Thread-0x800a77a8
>>  File 
>> "/usr/local/freevo/runtime/lib/python2.3/site-packages/mmpython/disc/dvdinfo.py", 
>> line 97, in isDisc
>>Thread-0x80015200
>>  File "/usr/local/freevo/src/main.py", line 334, in main_func
>>Fatal Python error: (pygame parachute) Segmentation Fault
>>gandalf:~ #

Strange. Replace dvdinfo.py, remove dvdinfo.pyc and dvdinfo.pyo if
they exist.


OK, here comes the new version:

#if 0 /*
# -----------------------------------------------------------------------
# dvdinfo.py - parse dvd title structure
# -----------------------------------------------------------------------
# $Id: dvdinfo.py,v 1.10 2003/06/30 13:17:19 the_krow Exp $
#
# -----------------------------------------------------------------------
# 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
#
# ----------------------------------------------------------------------- */
#endif

import ifoparser
from mmpython import mediainfo
import mmpython
from discinfo import DiscInfo
import popen2

# XXX this is really bad, but we are in a freevo
# XXX env and it should work
import config

class DVDTitle(mediainfo.AVInfo):
    def __init__(self, number):
        mediainfo.AVInfo.__init__(self)
        self.number = number
        self.chapters = self.angles = self.length = audio_num = subtitles_num = 0
        self.mime = 'video/mpeg'

            
class DVDInfo(DiscInfo):
    def __init__(self,device):
        DiscInfo.__init__(self)
        self.context = 'video'
        self.offset = 0
        self.valid = self.isDisc(device)
        self.mime = 'video/dvd'
        self.type = 'DVD'
        self.subtype = 'video'

    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(32808, 0)
        buffer = f.read(50000)

        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

        child = popen2.Popen3('%s dvd://99 -dvd-device %s' % \
                              (config.CONF.mplayer, device), 1, 100)
        title_num = 0
        while (1):
            data = child.fromchild.readline()
            if not data:
                break
            if data.startswith('There are '):
                title_num =  int(data[10:data[10:].find(' ')+10])
            
        child.wait()

        if not title_num:
            return 0

        for title in range(1, title_num+1):
            ti = DVDTitle(title)
            ti.trackno = title
            ti.trackof = title_num
            self.appendtrack(ti)

        return 1



mmpython.registertype( 'video/dvd', mediainfo.EXTENSION_DEVICE, mediainfo.TYPE_AV, 
DVDInfo )

Dischi

-- 
It's not Area 51 I'm worried about- it's Areas 1 through 50.

Reply via email to