[MPlayer-dev-eng] [PATCH] libdvdread 0.9.5 update

Robert Bradbury robert.bradbury at gmail.com
Mon Aug 13 04:49:36 CEST 2007


On 8/12/07, Paul Arthur <flowerysong00 at yahoo.com> wrote:
>
>
> >> >>Here is a patch to update libdvdread to version 0.9.5.  This is just
> the
> >> >>functional part without the cosmetics.  Testing is welcome,
> especially
> >> >>on 64 bits.  It works on my AMD K6-III, I'll try on PPC tomorrow.
>

Could someone bring me up to date on this (I just joined the Dev list).
I've spent the last couple of days wrestling with dvdread and libdvdcss in
the mplayer sources and the external system libraries.  The code in all of
the libraries involving lseek() on DVDs appears to be just plain wrong
(lseek returns a -1 on errors, not a value less than zero which is what the
current code tests for) [1].

I'm getting seek errors on DVDs when the "DVD" block number * 2048 exceeds
the size of a 32-bit integer (i.e. > 4GB dual layer DVDs).  I've tried
changing the code to use lseek64 on an i386 in the current release of Gentoo
Linux libraries and recent Gentoo release of Mplayer but still haven't
gotten it to work reliably yet.  As an aside, I'll comment that the code for
seeking and reading appears to not be particularly well written (the
original definition for DVDs spec'ed that their size could be > 4GB) and I'm
uncertain about how far I should go in changing it (to full 64 bit offsets)
due to the dual nature of the code being in mplayer and in system libraries
(where changing the dvdseek argument types would appear to be problematic).

Could anyone give me a short summary as to the problem status and/or point
me at specific files which have changed? [2]

Thanks, Robert

1. Even this is problematic because 0xFFFFFFFF is a valid byte address (and
therefore a valid lseek() return value) on DVDs.  The proper solution is
probably to use _llseek() on Linux systems since it always returns 0 for a
successful seek operation.
2. I'd prefer not to have to download a complete development version of
mplayer if I can avoid it.



More information about the MPlayer-dev-eng mailing list