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
ae3db51e
Commit
ae3db51e
authored
May 13, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: prepare private data ("owner") structure for input item
parent
04146d87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
43 deletions
+47
-43
src/input/item.c
src/input/item.c
+40
-43
src/input/item.h
src/input/item.h
+7
-0
No files found.
src/input/item.c
View file @
ae3db51e
...
...
@@ -39,45 +39,6 @@
static
int
GuessType
(
const
input_item_t
*
p_item
);
static
inline
void
input_item_Clean
(
input_item_t
*
p_i
)
{
int
i
;
vlc_event_manager_fini
(
&
p_i
->
event_manager
);
free
(
p_i
->
psz_name
);
free
(
p_i
->
psz_uri
);
if
(
p_i
->
p_stats
)
{
vlc_mutex_destroy
(
&
p_i
->
p_stats
->
lock
);
free
(
p_i
->
p_stats
);
}
if
(
p_i
->
p_meta
)
vlc_meta_Delete
(
p_i
->
p_meta
);
for
(
i
=
0
;
i
<
p_i
->
i_options
;
i
++
)
free
(
p_i
->
ppsz_options
[
i
]
);
TAB_CLEAN
(
p_i
->
i_options
,
p_i
->
ppsz_options
);
free
(
p_i
->
optflagv
);
for
(
i
=
0
;
i
<
p_i
->
i_es
;
i
++
)
{
es_format_Clean
(
p_i
->
es
[
i
]
);
free
(
p_i
->
es
[
i
]
);
}
TAB_CLEAN
(
p_i
->
i_es
,
p_i
->
es
);
for
(
i
=
0
;
i
<
p_i
->
i_epg
;
i
++
)
vlc_epg_Delete
(
p_i
->
pp_epg
[
i
]
);
TAB_CLEAN
(
p_i
->
i_epg
,
p_i
->
pp_epg
);
for
(
i
=
0
;
i
<
p_i
->
i_categories
;
i
++
)
info_category_Delete
(
p_i
->
pp_categories
[
i
]
);
TAB_CLEAN
(
p_i
->
i_categories
,
p_i
->
pp_categories
);
vlc_mutex_destroy
(
&
p_i
->
lock
);
}
void
input_item_SetErrorWhenReading
(
input_item_t
*
p_i
,
bool
b_error
)
{
bool
b_changed
;
...
...
@@ -449,9 +410,43 @@ bool input_item_IsArtFetched( input_item_t *p_item )
static
void
input_item_Destroy
(
gc_object_t
*
p_gc
)
{
input_item_t
*
p_item
=
vlc_priv
(
p_gc
,
input_item_t
);
input_item_owner_t
*
owner
=
item_owner
(
p_item
);
vlc_event_manager_fini
(
&
p_item
->
event_manager
);
free
(
p_item
->
psz_name
);
free
(
p_item
->
psz_uri
);
if
(
p_item
->
p_stats
!=
NULL
)
{
vlc_mutex_destroy
(
&
p_item
->
p_stats
->
lock
);
free
(
p_item
->
p_stats
);
}
if
(
p_item
->
p_meta
!=
NULL
)
vlc_meta_Delete
(
p_item
->
p_meta
);
for
(
int
i
=
0
;
i
<
p_item
->
i_options
;
i
++
)
free
(
p_item
->
ppsz_options
[
i
]
);
TAB_CLEAN
(
p_item
->
i_options
,
p_item
->
ppsz_options
);
free
(
p_item
->
optflagv
);
input_item_Clean
(
p_item
);
free
(
p_item
);
for
(
int
i
=
0
;
i
<
p_item
->
i_es
;
i
++
)
{
es_format_Clean
(
p_item
->
es
[
i
]
);
free
(
p_item
->
es
[
i
]
);
}
TAB_CLEAN
(
p_item
->
i_es
,
p_item
->
es
);
for
(
int
i
=
0
;
i
<
p_item
->
i_epg
;
i
++
)
vlc_epg_Delete
(
p_item
->
pp_epg
[
i
]
);
TAB_CLEAN
(
p_item
->
i_epg
,
p_item
->
pp_epg
);
for
(
int
i
=
0
;
i
<
p_item
->
i_categories
;
i
++
)
info_category_Delete
(
p_item
->
pp_categories
[
i
]
);
TAB_CLEAN
(
p_item
->
i_categories
,
p_item
->
pp_categories
);
vlc_mutex_destroy
(
&
p_item
->
lock
);
free
(
owner
);
}
int
input_item_AddOption
(
input_item_t
*
p_input
,
const
char
*
psz_option
,
...
...
@@ -811,9 +806,11 @@ input_item_NewWithType( const char *psz_uri, const char *psz_name,
{
static
vlc_atomic_t
last_input_id
=
VLC_ATOMIC_INIT
(
0
);
input_item_
t
*
p_input
=
calloc
(
1
,
sizeof
(
*
p_input
)
);
if
(
!
p_input
)
input_item_
owner_t
*
owner
=
calloc
(
1
,
sizeof
(
*
owner
)
);
if
(
unlikely
(
owner
==
NULL
)
)
return
NULL
;
input_item_t
*
p_input
=
&
owner
->
item
;
vlc_event_manager_t
*
p_em
=
&
p_input
->
event_manager
;
p_input
->
i_id
=
vlc_atomic_inc
(
&
last_input_id
);
...
...
src/input/item.h
View file @
ae3db51e
...
...
@@ -29,4 +29,11 @@
void
input_item_SetErrorWhenReading
(
input_item_t
*
p_i
,
bool
b_error
);
void
input_item_UpdateTracksInfo
(
input_item_t
*
item
,
const
es_format_t
*
fmt
);
typedef
struct
input_item_owner
{
input_item_t
item
;
}
input_item_owner_t
;
# define item_owner(item) ((struct input_item_owner *)(item))
#endif
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