Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
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)
...
@@ -561,20 +561,29 @@ static char *disc_get_name (struct udev_device *dev)
static
char
*
disc_get_cat
(
struct
udev_device
*
dev
)
static
char
*
disc_get_cat
(
struct
udev_device
*
dev
)
{
{
const
char
*
val
;
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"
);
struct
udev_list_entry
*
prop_list
if
(
val
&&
atoi
(
val
))
=
udev_device_get_properties_list_entry
(
dev
);
cat
=
"CD"
;
val
=
udev_device_get_property_value
(
dev
,
"ID_CDROM_MEDIA_DVD"
);
udev_list_entry_foreach
(
prop_list
,
prop_list
)
if
(
val
&&
atoi
(
val
))
{
cat
=
"DVD"
;
name
=
udev_list_entry_get_name
(
prop_list
);
val
=
udev_device_get_property_value
(
dev
,
"ID_CDROM_MEDIA_BD"
);
i_val
=
atoi
(
udev_list_entry_get_value
(
prop_list
)
);
if
(
val
&&
atoi
(
val
))
if
(
!
i_val
)
continue
;
cat
=
"Blue-ray disc"
;
if
(
strncmp
(
name
,
"ID_CDROM_MEDIA_CD"
,
strlen
(
"ID_CDROM_MEDIA_CD"
)
)
)
val
=
udev_device_get_property_value
(
dev
,
"ID_CDROM_MEDIA_HDDVD"
);
cat
=
_
(
"CD"
);
if
(
val
&&
atoi
(
val
))
else
if
(
!
strncmp
(
name
,
"ID_CDROM_MEDIA_DVD"
,
strlen
(
"ID_CDROM_MEDIA_DVD"
)
)
)
cat
=
"HD 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
);
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