[MPlayer-dev-eng] Audio CD questions

Ingo Brückl ib at wupperonline.de
Fri Dec 16 15:07:26 CET 2011


Reimar Döffinger wrote on Thu, 15 Dec 2011 20:25:42 +0100:

> On Thu, Dec 15, 2011 at 02:49:50PM +0100, Ingo Brückl wrote:
>> 3. Although I get the correct numbers of total tracks with the
>>    MSGTR_MPDEMUX_CDDA_AudioCDFoundWithNTracks message, stream_control()'s
>>    STREAM_CTRL_GET_NUM_CHAPTERS returns nothing but 1, because start_track
>>    and end_track in stream_cdda.c always seem to be 1 while the following
>>    patch seems to work. Is it a bug or am I doing something wrong?

> You told it to only play track 1 and not the whole CD probably.
> In that case there is only one chapter/track (within that one track it
> was told to play).

Yes, you're right, but this confuses me now.

I've taken the VCD code in the GUI as a template for audio CD. VCD starts
with "vcd://2" (i.e. track 2, because VCD tracks 1 usually contain a file
system), thus audio starts with "cdda://1" (as DVD does with "dvd://1").
MPlayer's documentation says that these numbers are the track number and
despite the name STREAM_CTRL_GET_NUM_CHAPTERS, stream_control() returns the
correct number of VCD tracks (vcd_end_track()).

I'm confused now whether there are "tracks" on VCDs and audio CDs or
"chapters" and how stream_control() should behave. (In my understanding, a
track - or title as named with DVDs - can contain chapters, and tracks/titles
are the topmost items on a media.)

If I use "cdda://", stream_control() returns the number of "tracks" (in my
understanding, i.e. the number of songs). (Well, almost. It returns the
number minus one. Bug or zero based indices?) But I'll end up with playing
one, big song (representing the whole audio CD).

What I'd like to achieve is playing the CD song by song as if these were in a
playlist (like a VCD plays track by track and a DVD title by title). In order
to be able to do this, I'd need the "number of songs".

Unfortunately cdda_priv is defined in stream_cdda.c (not in stream_cdda.h) so
I don't have a structure information to access the number of tracks directly
(as it is done with DVD's dvd_priv_t in interface.c, case GUI_SET_STREAM,
STREAMTYPE_DVD).

> But make sure to check against the command line version and the chapter
> switch commands and with specifying explicit track numbers.

I did so and got even more confused.

When playing a single track, the first jump with @ results in a positioning
error and it keeps playing, the second jump ends playback.

When playing the whole CD (not specifying a track), jumping with @ works
until you are playing the last song which you cannot leave with the jump key.

It says "Track n+1" and "Chapter: n" while playing song #n.

I don't know whether there is something wrong, but at least it's strange.

Well, anyway. What I basically need to know is how to get the "number of
songs" of an audio CD?

Ingo


More information about the MPlayer-dev-eng mailing list