[MPlayer-dev-eng] Re: reworked cd-dvd.html

Arpi arpi at thot.banki.hu
Mon Aug 5 00:50:09 CEST 2002


Hi,

> >  > Many systems surrently have the supermount feature enabled. Which means if
> >  > u put a vcd it will be mounted auto. Will that prevent mplayer from
> >  > playing the vcd ? Its confusing because if the device is not mounted
> >  > mplayer cannot read anything at all. May be the statement should be like:
> >  > 
> >  > Make sure that the VCD is mounted. But do not try to play the mounted DAT
> >  > files directly!
> > 
> > Hmm, to be honest I have no idea whether this is true or not..  I need
> > to get a VCD for testing.
> 
> I checked the latest version (1.34). I still suggest that u change this to
> what I suggested. Its kind of obvious that if the system does not mount
> the file system, no app can read the files. I remember having played a vcd
why?

> only after mounting it.

then it wasn't vcd or your memories are bad.

vcd disks consists of 2 or more track:
first track is a few MB 2048 bytes/sector data track, with an iso9660
filesystem, usualy containing win32 vcd player progy, and maybe other infos,
jpegs, text etc.

the second and other tracks are raw 2324 bytes/sector mpeg tracks, without
any filesystem but raw mpeg ps data, one packet per sector. they contain the
movie(s)... you can't mount these tracks, they are just like the audio
tracks - did you ever mounted an audio cd to play it??? no.

i've seen and made vcd disks without the first track, so they had a single
track and no filesystems at all. thay are still playable, but you can't
mount it. ah, and you can't play them under windoze :)

about video/mpegav.dat or what's its name - that ~600m file visible on
mounted vcd first track. it isn't a real track! it's a so called iso
gateway, to make silly OSes like windows or macos able to handle it.
(they don't allow raw device access to apps at all)
under linux, you cannot copy & play this file - it contains garbage.
under windows you can, as the iso9660 driver of windows emulates the raw
reading of tracks in this file. anyway powerdvd linux version contains a
kernel driver, a modified iso9660 fs driver, which is able to emulate the
raw tracks through this shadow .dat file. if you mount the disc using their
driver, you can copy and even play with mplayer the .dat file. but you can
NOT do that with the standard iso9660 driver of teh kernel!!!

that's all for vcd.
now let's see teh dvd dics. they are simple...

yes, dvd discs has no raw 2324 b/s sectors, they use all 2048 b/s with
ecc/crc. dvd dics usualy have an UDF filesystem on a single track,
containing various files, including some with .IFO extension.
they also contain big ~1GB .vob files too. they are real files, on
unencrypted dvds you can copy and/or play them from mounted fs.

anyway teh .ifo file, which actually contains the 'directory' of the
movie (chapter/title/angle map, language table etc) uses _sectors_
everywhere. so, even if you have the filesystem mounted, and you can see
the .vob files, if you want to implement dvd navigation, you have to use
raw addressing of sectors of the disc. raw sectors also needed to do decss.

so, some very old version of libdvdread, and teh whole old-style dvd
playing with libcss needed a _mounted_ dvd filesystem, and _also_
raw sector-based access to the device.
the worst thing, that for getting the sector address of a file, under
linux you must be root. it's nonsense, and was discussed many times at
kernel dev lists, but they didn't promise change before the 2.5.x tree.
so, we have to choose: force user to be root (remember - that file called
fibmap_mplayer - it's suid root and it actually does the dvd access for
old-style libcss playback) _OR_ don't use the kernel's filesystem driver
at all, and re-implement it in userspace. libdvdread 0.9.x and libmpdvdkit
does this. so, it doesn't matter if you mount teh dvd using the kernel's
udf filesystem driver, as it's useless for us, we have our own udf fs driver
built-in into libdvdread. so, we don't need teh dvd to be mounted, we
only use raw sector-based access.

anyway, things are even more complicated :)
libdvdread authors find out, that on some systems the /dev/dvd isn't
readable by users - so they've implemented an emulation layer which transfers
sector addesses to filenames+offsets, so it can emulate raw access on the
top of a mounted filesystem or even on a hdd :)

so, back to the question - for dvd you have 2 choices:
- you have it mounted to somewhere
- you have raw access to /dev/dvd

for vcd, mpalyer and all unix players (including mpegtv, xine, ogle etc)
requires raw access to teh device, and it doesn't need the mounted path at
all.

apropos mounted path...
libdvdread is even more crazy...
it accepts teh mountpoint instead of teh device name for raw access, it
checks in /proc/mounts to transfer it to devname.
they developed it for solaris, where device names are dinamically allocated,
consists from controller ids and disc ids, and are auto-mounted by OS to a
constant path...

please, add all this to the docs...
i've explained the above already many times on many lists, time to make it
RTFM.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list