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
058bc838
Commit
058bc838
authored
Nov 20, 2006
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Audio cds and their tracks at ejection
Detect audio and video on CD-R and DVD-R mediums
parent
aad95f66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
15 deletions
+37
-15
modules/services_discovery/hal.c
modules/services_discovery/hal.c
+37
-15
No files found.
modules/services_discovery/hal.c
View file @
058bc838
...
@@ -216,7 +216,7 @@ static void AddItem( services_discovery_t *p_sd, input_item_t * p_input
...
@@ -216,7 +216,7 @@ static void AddItem( services_discovery_t *p_sd, input_item_t * p_input
#endif
#endif
)
)
{
{
playlist_item_t
*
p_item
;
playlist_item_t
*
p_item
_cat
,
*
p_item_one
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_sd
,
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_sd
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
...
@@ -225,12 +225,12 @@ static void AddItem( services_discovery_t *p_sd, input_item_t * p_input
...
@@ -225,12 +225,12 @@ static void AddItem( services_discovery_t *p_sd, input_item_t * p_input
msg_Err
(
p_sd
,
"playlist not found"
);
msg_Err
(
p_sd
,
"playlist not found"
);
return
;
return
;
}
}
p_item
=
playlist_NodeAddInput
(
p_playlist
,
p_input
,
p_sd
->
p_sys
->
p_node_ca
t
,
p_item
_cat
=
playlist_NodeAddInput
(
p_playlis
t
,
PLAYLIST_APPEND
,
PLAYLIST_END
);
p_input
,
p_sd
->
p_sys
->
p_node_cat
,
PLAYLIST_APPEND
,
PLAYLIST_END
);
p_item
->
i_flags
&=
~
PLAYLIST_SKIP_FLAG
;
p_item
_cat
->
i_flags
&=
~
PLAYLIST_SKIP_FLAG
;
p_item
=
playlist_NodeAddInput
(
p_playlist
,
p_input
,
p_sd
->
p_sys
->
p_node_one
,
p_item
_one
=
playlist_NodeAddInput
(
p_playlist
,
PLAYLIST_APPEND
,
PLAYLIST_END
);
p_input
,
p_sd
->
p_sys
->
p_node_one
,
PLAYLIST_APPEND
,
PLAYLIST_END
);
p_item
->
i_flags
&=
~
PLAYLIST_SKIP_FLAG
;
p_item
_one
->
i_flags
&=
~
PLAYLIST_SKIP_FLAG
;
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
...
@@ -241,7 +241,7 @@ static void AddItem( services_discovery_t *p_sd, input_item_t * p_input
...
@@ -241,7 +241,7 @@ static void AddItem( services_discovery_t *p_sd, input_item_t * p_input
{
{
return
;
return
;
}
}
p_udi_entry
->
i_id
=
p_item
->
i_id
;
p_udi_entry
->
i_id
=
p_item
_cat
->
i_id
;
p_udi_entry
->
psz_udi
=
strdup
(
psz_device
);
p_udi_entry
->
psz_udi
=
strdup
(
psz_device
);
TAB_APPEND
(
p_sys
->
i_devices_number
,
p_sys
->
pp_devices
,
p_udi_entry
);
TAB_APPEND
(
p_sys
->
i_devices_number
,
p_sys
->
pp_devices
,
p_udi_entry
);
#endif
#endif
...
@@ -283,7 +283,8 @@ static void AddDvd( services_discovery_t *p_sd, char *psz_device )
...
@@ -283,7 +283,8 @@ static void AddDvd( services_discovery_t *p_sd, char *psz_device )
static
void
DelItem
(
services_discovery_t
*
p_sd
,
char
*
psz_udi
)
static
void
DelItem
(
services_discovery_t
*
p_sd
,
char
*
psz_udi
)
{
{
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
int
i
;
int
i
,
j
;
playlist_item_t
*
p_pl_item
;
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_sd
,
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_sd
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
...
@@ -294,11 +295,32 @@ static void DelItem( services_discovery_t *p_sd, char* psz_udi )
...
@@ -294,11 +295,32 @@ static void DelItem( services_discovery_t *p_sd, char* psz_udi )
}
}
for
(
i
=
0
;
i
<
p_sys
->
i_devices_number
;
i
++
)
for
(
i
=
0
;
i
<
p_sys
->
i_devices_number
;
i
++
)
{
{
/* looks for a matching udi */
if
(
strcmp
(
psz_udi
,
p_sys
->
pp_devices
[
i
]
->
psz_udi
)
==
0
)
if
(
strcmp
(
psz_udi
,
p_sys
->
pp_devices
[
i
]
->
psz_udi
)
==
0
)
{
/* delete the corresponding item */
p_pl_item
=
playlist_ItemGetById
(
p_playlist
,
p_sys
->
pp_devices
[
i
]
->
i_id
,
VLC_FALSE
);
if
(
p_pl_item
)
{
{
msg_Err
(
p_sd
,
"HAL delete must be fixed"
);
j
=
0
;
/* playlist_DeleteFromItemId( p_playlist, p_sys->pp_devices[i]->i_id );*/
while
(
p_pl_item
->
i_children
>
0
)
{
/* delete all childs */
playlist_DeleteFromInput
(
p_playlist
,
p_pl_item
->
pp_children
[
j
]
->
p_input
->
i_id
,
VLC_FALSE
);
}
/* delete parent item */
/* HACK: if i_children == 0 the item won't be deleted
* That means that it _had_ children but they were deleted */
if
(
p_pl_item
->
i_children
==
0
)
p_pl_item
->
i_children
=
-
1
;
playlist_DeleteFromInput
(
p_playlist
,
p_pl_item
->
p_input
->
i_id
,
VLC_FALSE
);
}
if
(
p_sys
->
pp_devices
[
i
]
->
psz_udi
)
free
(
p_sys
->
pp_devices
[
i
]
->
psz_udi
);
TAB_REMOVE
(
p_sys
->
i_devices_number
,
p_sys
->
pp_devices
,
TAB_REMOVE
(
p_sys
->
i_devices_number
,
p_sys
->
pp_devices
,
p_sys
->
pp_devices
[
i
]
);
p_sys
->
pp_devices
[
i
]
);
}
}
...
@@ -353,7 +375,7 @@ static void ParseDevice( services_discovery_t *p_sd, char *psz_device )
...
@@ -353,7 +375,7 @@ static void ParseDevice( services_discovery_t *p_sd, char *psz_device )
psz_device
,
psz_device
,
"volume.disc.type"
);
"volume.disc.type"
);
#endif
#endif
if
(
!
str
cmp
(
psz_disc_type
,
"dvd_rom"
)
)
if
(
!
str
ncmp
(
psz_disc_type
,
"dvd_r"
,
5
)
)
{
{
#ifdef HAVE_HAL_1
#ifdef HAVE_HAL_1
/* hal 0.2.9.7 (HAVE_HAL) has not is_videodvd
/* hal 0.2.9.7 (HAVE_HAL) has not is_videodvd
...
@@ -363,7 +385,7 @@ static void ParseDevice( services_discovery_t *p_sd, char *psz_device )
...
@@ -363,7 +385,7 @@ static void ParseDevice( services_discovery_t *p_sd, char *psz_device )
#endif
#endif
AddDvd
(
p_sd
,
psz_device
);
AddDvd
(
p_sd
,
psz_device
);
}
}
else
if
(
!
str
cmp
(
psz_disc_type
,
"cd_rom"
)
)
else
if
(
!
str
ncmp
(
psz_disc_type
,
"cd_r"
,
4
)
)
{
{
#ifdef HAVE_HAL_1
#ifdef HAVE_HAL_1
if
(
libhal_device_get_property_bool
(
p_sys
->
p_ctx
,
psz_device
,
if
(
libhal_device_get_property_bool
(
p_sys
->
p_ctx
,
psz_device
,
...
...
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