* Correctly detect Enhanced CDs, and take their extra lead gap into account.
* This fixes bug #3025. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41290 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007-2008, Axel Dörfler, [email protected].
|
* Copyright 2007-2011, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef CDDA_H
|
#ifndef CDDA_H
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
static const uint32 kFramesPerSecond = 75;
|
static const uint32 kFramesPerSecond = 75;
|
||||||
static const uint32 kFramesPerMinute = kFramesPerSecond * 60;
|
static const uint32 kFramesPerMinute = kFramesPerSecond * 60;
|
||||||
static const uint32 kFrameSize = 2352;
|
static const uint32 kFrameSize = 2352;
|
||||||
|
static const uint32 kDataTrackLeadGap = 11400;
|
||||||
static const uint8 kMaxTracks = 0x63;
|
static const uint8 kMaxTracks = 0x63;
|
||||||
|
|
||||||
struct cdtext {
|
struct cdtext {
|
||||||
|
|||||||
@@ -653,10 +653,10 @@ Volume::Mount(const char* device)
|
|||||||
// We do not seem to have an attribute file so this is probably the
|
// We do not seem to have an attribute file so this is probably the
|
||||||
// first time this CD is inserted. In this case, try to read CD-Text
|
// first time this CD is inserted. In this case, try to read CD-Text
|
||||||
// data.
|
// data.
|
||||||
if (read_cdtext(fDevice, text) != B_OK)
|
if (read_cdtext(fDevice, text) == B_OK)
|
||||||
dprintf("CDDA: no CD-Text found.\n");
|
|
||||||
else
|
|
||||||
doLookup = false;
|
doLookup = false;
|
||||||
|
else
|
||||||
|
TRACE(("CDDA: no CD-Text found.\n"));
|
||||||
} else {
|
} else {
|
||||||
doLookup = false;
|
doLookup = false;
|
||||||
}
|
}
|
||||||
@@ -677,6 +677,12 @@ Volume::Mount(const char* device)
|
|||||||
+ next.second * kFramesPerSecond + next.frame
|
+ next.second * kFramesPerSecond + next.frame
|
||||||
- startFrame;
|
- startFrame;
|
||||||
|
|
||||||
|
// Adjust length of the last audio track according to the Blue Book
|
||||||
|
// specification in case of an Enhanced CD
|
||||||
|
if (i + 1 < trackCount && is_data_track(toc->tracks[i + 1])
|
||||||
|
&& !is_data_track(toc->tracks[i]))
|
||||||
|
frames -= kDataTrackLeadGap;
|
||||||
|
|
||||||
totalFrames += frames;
|
totalFrames += frames;
|
||||||
|
|
||||||
if (is_data_track(toc->tracks[i]))
|
if (is_data_track(toc->tracks[i]))
|
||||||
|
|||||||
Reference in New Issue
Block a user