[MPlayer-dev-eng] Audio CD questions

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Dec 16 21:19:30 CET 2011


On Fri, Dec 16, 2011 at 03:07:26PM +0100, Ingo Brückl wrote:
> 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.)

There are no chapters for VCD or audio CDs, so misusing them for tracks
seemed appropriate.
Now as to the difference in behaviour between CD and VCD:
For VCD you'd generally not want to play more than one track, whereas
for some CDs you will absolutely want to play the CD front to end in one
go without interruptions (just as you wouldn't want a short pause at
each new chapter for a DVD).
However there are also CDs where you'd rather have each track treated
like a single file. Thus cdda has this strange split behaviour.

> 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).

Yes, that is the intention. Well, except for that off-by-one issue.

> 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".

cdda:// with e.g. -chapter 1-1 should either work or be made to work.
At least that would be my suggestion for solving it.
Better ideas are welcome, however both the functionality of cdda:// and
cdda://1 needs to stay available IMO (though not necessarily with
that syntax).

> 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).

Urgh, I can't say I think that is how it _should_ be done.

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

Well, you already found a way, using cdda://.
The thing is how to combine that with only playing one track.
Suggestions are either -chapter (IMO preferable if we can get
it to work nicely) or making NUM_CHAPTERS return the number
also for cdda://1 - I dislike it a bit because I think
with cdda://1 "next chapter" should end playback, not go on
to cdda://2.


More information about the MPlayer-dev-eng mailing list