aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-12-22 08:58:49 +0100
committerMax Kellermann <max@duempel.org>2010-12-22 09:43:53 +0100
commit8bda52783b89533b431b9883d507398044885bcc (patch)
tree4be4a5a1c87a864da55f936c3eabf58ef66abebf /src/input
parent07feec7ea6437799e7faac1e83b287243e825e0f (diff)
downloadmpd-8bda52783b89533b431b9883d507398044885bcc.tar.gz
mpd-8bda52783b89533b431b9883d507398044885bcc.tar.xz
mpd-8bda52783b89533b431b9883d507398044885bcc.zip
input/cdda: support reading the whole disc
Diffstat (limited to '')
-rw-r--r--src/input/cdda_input_plugin.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/input/cdda_input_plugin.c b/src/input/cdda_input_plugin.c
index 63a718c8d..df570190f 100644
--- a/src/input/cdda_input_plugin.c
+++ b/src/input/cdda_input_plugin.c
@@ -217,17 +217,15 @@ input_cdda_open(const char *uri, GError **error_r)
return NULL;
}
- if (i->trackno == -1) {
- g_set_error(error_r, cdda_quark(), 0,
- "Invalid track # in %s", uri);
- input_cdda_close(&i->base);
- return NULL;
- }
-
-
i->lsn_relofs = 0;
- i->lsn_from = cdio_get_track_lsn( i->cdio, i->trackno );
- i->lsn_to = cdio_get_track_last_lsn( i->cdio, i->trackno );
+
+ if (i->trackno >= 0) {
+ i->lsn_from = cdio_get_track_lsn(i->cdio, i->trackno);
+ i->lsn_to = cdio_get_track_last_lsn(i->cdio, i->trackno);
+ } else {
+ i->lsn_from = 0;
+ i->lsn_to = cdio_get_disc_last_lsn(i->cdio);
+ }
i->para = cdio_paranoia_init(i->drv);