Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
b865e213
Commit
b865e213
authored
Feb 15, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udev: improve disc type recognition for -R -RW and alikes
parent
58e693a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
modules/services_discovery/udev.c
modules/services_discovery/udev.c
+22
-13
No files found.
modules/services_discovery/udev.c
View file @
b865e213
...
...
@@ -561,20 +561,29 @@ static char *disc_get_name (struct udev_device *dev)
static
char
*
disc_get_cat
(
struct
udev_device
*
dev
)
{
const
char
*
val
;
const
char
*
cat
=
"Unknown"
;
const
char
*
name
;
int
i_val
;
const
char
*
cat
=
_
(
"Unknown Type"
);
val
=
udev_device_get_property_value
(
dev
,
"ID_CDROM_MEDIA_CD"
);
if
(
val
&&
atoi
(
val
))
cat
=
"CD"
;
val
=
udev_device_get_property_value
(
dev
,
"ID_CDROM_MEDIA_DVD"
);
if
(
val
&&
atoi
(
val
))
cat
=
"DVD"
;
val
=
udev_device_get_property_value
(
dev
,
"ID_CDROM_MEDIA_BD"
);
if
(
val
&&
atoi
(
val
))
cat
=
"Blue-ray disc"
;
val
=
udev_device_get_property_value
(
dev
,
"ID_CDROM_MEDIA_HDDVD"
);
if
(
val
&&
atoi
(
val
))
cat
=
"HD DVD"
;
struct
udev_list_entry
*
prop_list
=
udev_device_get_properties_list_entry
(
dev
);
udev_list_entry_foreach
(
prop_list
,
prop_list
)
{
name
=
udev_list_entry_get_name
(
prop_list
);
i_val
=
atoi
(
udev_list_entry_get_value
(
prop_list
)
);
if
(
!
i_val
)
continue
;
if
(
strncmp
(
name
,
"ID_CDROM_MEDIA_CD"
,
strlen
(
"ID_CDROM_MEDIA_CD"
)
)
)
cat
=
_
(
"CD"
);
else
if
(
!
strncmp
(
name
,
"ID_CDROM_MEDIA_DVD"
,
strlen
(
"ID_CDROM_MEDIA_DVD"
)
)
)
cat
=
_
(
"DVD"
);
else
if
(
!
strncmp
(
name
,
"ID_CDROM_MEDIA_BD"
,
strlen
(
"ID_CDROM_MEDIA_BD"
)
)
)
cat
=
_
(
"Blu-Ray"
);
else
if
(
!
strncmp
(
name
,
"ID_CDROM_MEDIA_HDDVD"
,
strlen
(
"ID_CDROM_MEDIA_HDDVD"
)
)
)
cat
=
_
(
"HD DVD"
);
}
free
(
prop_list
);
return
strdup
(
cat
);
}
...
...
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