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
b14d7afa
Commit
b14d7afa
authored
Feb 05, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added input_item_ReplaceInfos() and input_item_MergeInfos.
They will allow to minimize the number of events sent.
parent
2feb065d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletion
+47
-1
include/vlc_input_item.h
include/vlc_input_item.h
+2
-0
src/input/item.c
src/input/item.c
+45
-1
No files found.
include/vlc_input_item.h
View file @
b14d7afa
...
...
@@ -238,6 +238,8 @@ INPUT_META(TrackID)
VLC_EXPORT
(
char
*
,
input_item_GetInfo
,
(
input_item_t
*
p_i
,
const
char
*
psz_cat
,
const
char
*
psz_name
)
);
VLC_EXPORT
(
int
,
input_item_AddInfo
,
(
input_item_t
*
p_i
,
const
char
*
psz_cat
,
const
char
*
psz_name
,
const
char
*
psz_format
,
...
)
LIBVLC_FORMAT
(
4
,
5
)
);
VLC_EXPORT
(
int
,
input_item_DelInfo
,
(
input_item_t
*
p_i
,
const
char
*
psz_cat
,
const
char
*
psz_name
)
);
VLC_EXPORT
(
void
,
input_item_ReplaceInfos
,
(
input_item_t
*
,
info_category_t
*
)
);
VLC_EXPORT
(
void
,
input_item_MergeInfos
,
(
input_item_t
*
,
info_category_t
*
)
);
/**
* This function creates a new input_item_t with the provided informations.
...
...
src/input/item.c
View file @
b14d7afa
...
...
@@ -625,7 +625,6 @@ int input_item_DelInfo( input_item_t *p_i,
const
char
*
psz_cat
,
const
char
*
psz_name
)
{
vlc_mutex_lock
(
&
p_i
->
lock
);
int
i_cat
;
info_category_t
*
p_cat
=
InputItemFindCat
(
p_i
,
&
i_cat
,
psz_cat
);
...
...
@@ -660,6 +659,51 @@ int input_item_DelInfo( input_item_t *p_i,
return
VLC_SUCCESS
;
}
void
input_item_ReplaceInfos
(
input_item_t
*
p_item
,
info_category_t
*
p_cat
)
{
vlc_mutex_lock
(
&
p_item
->
lock
);
int
i_cat
;
info_category_t
*
p_old
=
InputItemFindCat
(
p_item
,
&
i_cat
,
p_cat
->
psz_name
);
if
(
p_old
)
{
info_category_Delete
(
p_old
);
p_item
->
pp_categories
[
i_cat
]
=
p_cat
;
}
else
{
INSERT_ELEM
(
p_item
->
pp_categories
,
p_item
->
i_categories
,
p_item
->
i_categories
,
p_cat
);
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
vlc_event_t
event
;
event
.
type
=
vlc_InputItemInfoChanged
;
vlc_event_send
(
&
p_item
->
event_manager
,
&
event
);
}
void
input_item_MergeInfos
(
input_item_t
*
p_item
,
info_category_t
*
p_cat
)
{
vlc_mutex_lock
(
&
p_item
->
lock
);
info_category_t
*
p_old
=
InputItemFindCat
(
p_item
,
NULL
,
p_cat
->
psz_name
);
if
(
p_old
)
{
for
(
int
i
=
0
;
i
<
p_cat
->
i_infos
;
i
++
)
info_category_ReplaceInfo
(
p_old
,
p_cat
->
pp_infos
[
i
]
);
TAB_CLEAN
(
p_cat
->
i_infos
,
p_cat
->
pp_infos
);
info_category_Delete
(
p_cat
);
}
else
{
INSERT_ELEM
(
p_item
->
pp_categories
,
p_item
->
i_categories
,
p_item
->
i_categories
,
p_cat
);
}
vlc_mutex_unlock
(
&
p_item
->
lock
);
vlc_event_t
event
;
event
.
type
=
vlc_InputItemInfoChanged
;
vlc_event_send
(
&
p_item
->
event_manager
,
&
event
);
}
#define EPG_DEBUG
void
input_item_SetEpg
(
input_item_t
*
p_item
,
const
vlc_epg_t
*
p_update
)
...
...
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