Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
5c9c07f8
Commit
5c9c07f8
authored
Mar 23, 2007
by
Laurent Aimar
Browse files
Extended INPUT_DEL_INFO (Allow deleting a whole category with NULL name)
Fixed VLC_META_NOW_PLAYING update.
parent
d5c128a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/input/control.c
View file @
5c9c07f8
...
...
@@ -205,15 +205,16 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
char
*
psz_name
=
(
char
*
)
va_arg
(
args
,
char
*
);
info_category_t
*
p_cat
=
NULL
;
int
i_cat
;
int
i
;
vlc_mutex_lock
(
&
p_input
->
p
->
input
.
p_item
->
lock
);
for
(
i
=
0
;
i
<
p_input
->
p
->
input
.
p_item
->
i_categories
;
i
++
)
for
(
i
_cat
=
0
;
i
_cat
<
p_input
->
p
->
input
.
p_item
->
i_categories
;
i
_cat
++
)
{
if
(
!
strcmp
(
p_input
->
p
->
input
.
p_item
->
pp_categories
[
i
]
->
psz_name
,
if
(
!
strcmp
(
p_input
->
p
->
input
.
p_item
->
pp_categories
[
i
_cat
]
->
psz_name
,
psz_cat
)
)
{
p_cat
=
p_input
->
p
->
input
.
p_item
->
pp_categories
[
i
];
p_cat
=
p_input
->
p
->
input
.
p_item
->
pp_categories
[
i
_cat
];
break
;
}
}
...
...
@@ -223,27 +224,48 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
return
VLC_EGENERIC
;
}
for
(
i
=
0
;
i
<
p_cat
->
i_infos
;
i
++
)
if
(
psz_name
)
{
if
(
!
strcmp
(
p_cat
->
pp_infos
[
i
]
->
psz_name
,
psz_name
)
)
/* Remove a specific info */
for
(
i
=
0
;
i
<
p_cat
->
i_infos
;
i
++
)
{
if
(
!
strcmp
(
p_cat
->
pp_infos
[
i
]
->
psz_name
,
psz_name
)
)
{
free
(
p_cat
->
pp_infos
[
i
]
->
psz_name
);
if
(
p_cat
->
pp_infos
[
i
]
->
psz_value
)
free
(
p_cat
->
pp_infos
[
i
]
->
psz_value
);
free
(
p_cat
->
pp_infos
[
i
]
);
REMOVE_ELEM
(
p_cat
->
pp_infos
,
p_cat
->
i_infos
,
i
);
break
;
}
}
if
(
i
>=
p_cat
->
i_infos
)
{
vlc_mutex_unlock
(
&
p_input
->
p
->
input
.
p_item
->
lock
);
return
VLC_EGENERIC
;
}
}
else
{
/* Remove the complete categorie */
for
(
i
=
0
;
i
<
p_cat
->
i_infos
;
i
++
)
{
free
(
p_cat
->
pp_infos
[
i
]
->
psz_name
);
if
(
p_cat
->
pp_infos
[
i
]
->
psz_value
)
free
(
p_cat
->
pp_infos
[
i
]
->
psz_value
);
free
(
p_cat
->
pp_infos
[
i
]
);
REMOVE_ELEM
(
p_cat
->
pp_infos
,
p_cat
->
i_infos
,
i
);
break
;
}
if
(
p_cat
->
pp_infos
)
free
(
p_cat
->
pp_infos
);
REMOVE_ELEM
(
p_input
->
p
->
input
.
p_item
->
pp_categories
,
p_input
->
p
->
input
.
p_item
->
i_categories
,
i_cat
);
}
vlc_mutex_unlock
(
&
p_input
->
p
->
input
.
p_item
->
lock
);
if
(
i
>=
p_cat
->
i_infos
)
return
VLC_EGENERIC
;
if
(
!
p_input
->
b_preparsing
)
NotifyPlaylist
(
p_input
);
return
VLC_SUCCESS
;
}
return
VLC_SUCCESS
;
case
INPUT_GET_INFO
:
...
...
src/input/input.c
View file @
5c9c07f8
...
...
@@ -253,8 +253,8 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
}
/* Remove 'Now playing' info as it is probably outdated */
input_Control
(
p_input
,
INPUT_DEL_INFO
,
_
(
VLC_META_INFO_CAT
),
VLC_META_NOW_PLAYING
);
/* ? Don't translate as it might has been copied ? */
input_Control
(
p_input
,
INPUT_DEL_INFO
,
_
(
VLC_META_INFO_CAT
),
VLC_META_NOW_PLAYING
);
vlc_meta_SetNowPlaying
(
p_item
->
p_meta
,
NULL
);
/* */
if
(
p_input
->
b_preparsing
)
...
...
Write
Preview
Supports
Markdown
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