Mercurial > mplayer.hg
diff stream/stream_cdda.c @ 34386:206264c532f5
Add new stream control command STREAM_CTRL_GET_NUM_TITLES.
This provides the total number of titles (aka tracks) of CDs / VCDs / DVDs.
Additionally, add a titles property to the get_property slave command.
author | ib |
---|---|
date | Sat, 31 Dec 2011 12:20:08 +0000 |
parents | 475b95b38f59 |
children | 614c99d4cbbf |
line wrap: on
line diff
--- a/stream/stream_cdda.c Thu Dec 29 19:42:58 2011 +0000 +++ b/stream/stream_cdda.c Sat Dec 31 12:20:08 2011 +0000 @@ -243,6 +243,11 @@ static int control(stream_t *stream, int cmd, void *arg) { cdda_priv* p = stream->priv; switch(cmd) { + case STREAM_CTRL_GET_NUM_TITLES: + { + *(unsigned int *)arg = p->cd->tracks; + return STREAM_OK; + } case STREAM_CTRL_GET_NUM_CHAPTERS: { int start_track = get_track_by_sector(p, p->start_sector);