Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
be670bfd
Commit
be670bfd
authored
Dec 22, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/cdda: move code to cdda_detect_drive()
parent
19acf090
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
cdda_input_plugin.c
src/input/cdda_input_plugin.c
+18
-7
No files found.
src/input/cdda_input_plugin.c
View file @
be670bfd
...
...
@@ -82,11 +82,23 @@ input_cdda_close(struct input_stream *is)
g_free
(
i
);
}
static
char
*
cdda_detect_device
(
void
)
{
char
**
devices
=
cdio_get_devices_with_cap
(
NULL
,
CDIO_FS_AUDIO
,
false
);
if
(
devices
==
NULL
)
return
NULL
;
char
*
device
=
g_strdup
(
devices
[
0
]);
cdio_free_device_list
(
devices
);
return
device
;
}
static
struct
input_stream
*
input_cdda_open
(
const
char
*
uri
,
GError
**
error_r
)
{
struct
input_cdda
*
i
;
char
**
cd_drives
;
/* List of all drives with a loaded CDDA in it. */
if
(
!
g_str_has_prefix
(
uri
,
"cdda://"
))
return
NULL
;
...
...
@@ -108,8 +120,8 @@ input_cdda_open(const char *uri, GError **error_r)
}
/* get list of CD's supporting CD-DA */
c
d_drives
=
cdio_get_devices_with_cap
(
NULL
,
CDIO_FS_AUDIO
,
false
);
if
(
!
cd_drives
)
{
c
har
*
device
=
cdda_detect_device
(
);
if
(
device
==
NULL
)
{
g_set_error
(
error_r
,
cdda_quark
(),
0
,
"Unable find or access a CD-ROM drive with an audio CD in it."
);
input_cdda_close
(
i
);
...
...
@@ -117,11 +129,10 @@ input_cdda_open(const char *uri, GError **error_r)
}
/* Found such a CD-ROM with a CD-DA loaded. Use the first drive in the list. */
i
->
cdio
=
cdio_open
(
*
cd_drives
,
DRIVER_UNKNOWN
);
i
->
drv
=
cdio_cddap_identify_cdio
(
i
->
cdio
,
1
,
NULL
);
i
->
cdio
=
cdio_open
(
device
,
DRIVER_UNKNOWN
);
g_free
(
device
);
/* Don't need a list of CD's with CD-DA's any more. */
cdio_free_device_list
(
cd_drives
);
i
->
drv
=
cdio_cddap_identify_cdio
(
i
->
cdio
,
1
,
NULL
);
if
(
!
i
->
drv
)
{
g_set_error
(
error_r
,
cdda_quark
(),
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment