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
7c1437b3
Commit
7c1437b3
authored
Feb 15, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udev: fix obvious faults in previous commit, refactor
parent
24726bf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
21 deletions
+28
-21
modules/services_discovery/udev.c
modules/services_discovery/udev.c
+28
-21
No files found.
modules/services_discovery/udev.c
View file @
7c1437b3
...
...
@@ -560,32 +560,39 @@ static char *disc_get_name (struct udev_device *dev)
static
char
*
disc_get_cat
(
struct
udev_device
*
dev
)
{
const
char
*
val
;
const
char
*
name
;
int
i_val
;
const
char
*
cat
=
_
(
"Unknown Type"
);
struct
udev_list_entry
*
list
,
*
entry
;
struct
udev_list_entry
*
prop_list
=
udev_device_get_properties_list_entry
(
dev
);
list
=
udev_device_get_properties_list_entry
(
dev
);
if
(
unlikely
(
list
==
NULL
))
return
NULL
;
udev_list_entry_foreach
(
prop_list
,
prop_list
)
const
char
*
cat
=
NULL
;
udev_list_entry_foreach
(
entry
,
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"
);
}
const
char
*
name
=
udev_list_entry_get_name
(
entry
);
free
(
prop_list
);
if
(
strncmp
(
name
,
"ID_CDROM_MEDIA_"
,
15
))
continue
;
if
(
!
atoi
(
udev_list_entry_get_value
(
entry
)))
continue
;
name
+=
15
;
if
(
!
strncmp
(
name
,
"CD"
,
2
))
cat
=
N_
(
"CD"
);
else
if
(
!
strncmp
(
name
,
"DVD"
,
3
))
cat
=
N_
(
"DVD"
);
else
if
(
!
strncmp
(
name
,
"BD"
,
2
))
cat
=
N_
(
"Blu-Ray"
);
else
if
(
!
strncmp
(
name
,
"HDDVD"
,
5
))
cat
=
N_
(
"HD DVD"
);
if
(
cat
!=
NULL
)
break
;
}
return
strdup
(
cat
);
if
(
cat
==
NULL
)
cat
=
N_
(
"Unknown type"
);
return
strdup
(
vlc_gettext
(
cat
));
}
int
OpenDisc
(
vlc_object_t
*
obj
)
...
...
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