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
dca6b1f8
Commit
dca6b1f8
authored
Jul 10, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use vlc_atomic_t for input item ID
parent
da9ea07c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
8 deletions
+3
-8
src/input/item.c
src/input/item.c
+3
-5
src/libvlc.c
src/libvlc.c
+0
-2
src/libvlc.h
src/libvlc.h
+0
-1
No files found.
src/input/item.c
View file @
dca6b1f8
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "vlc_playlist.h"
#include "vlc_playlist.h"
#include "vlc_interface.h"
#include "vlc_interface.h"
#include <vlc_charset.h>
#include <vlc_charset.h>
#include <vlc_atomic.h>
#include "item.h"
#include "item.h"
#include "info.h"
#include "info.h"
...
@@ -844,8 +845,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
...
@@ -844,8 +845,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
mtime_t
i_duration
,
mtime_t
i_duration
,
int
i_type
)
int
i_type
)
{
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_obj
->
p_libvlc
);
static
vlc_atomic_t
last_input_id
=
VLC_ATOMIC_INIT
(
0
);
static
vlc_mutex_t
input_id_lock
=
VLC_STATIC_MUTEX
;
input_item_t
*
p_input
=
malloc
(
sizeof
(
input_item_t
)
);
input_item_t
*
p_input
=
malloc
(
sizeof
(
input_item_t
)
);
if
(
!
p_input
)
if
(
!
p_input
)
...
@@ -854,9 +854,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
...
@@ -854,9 +854,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
input_item_Init
(
p_obj
,
p_input
);
input_item_Init
(
p_obj
,
p_input
);
vlc_gc_init
(
p_input
,
input_item_Destroy
);
vlc_gc_init
(
p_input
,
input_item_Destroy
);
vlc_mutex_lock
(
&
input_id_lock
);
p_input
->
i_id
=
vlc_atomic_inc
(
&
last_input_id
);
p_input
->
i_id
=
++
priv
->
i_last_input_id
;
vlc_mutex_unlock
(
&
input_id_lock
);
p_input
->
b_fixed_name
=
false
;
p_input
->
b_fixed_name
=
false
;
...
...
src/libvlc.c
View file @
dca6b1f8
...
@@ -770,8 +770,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -770,8 +770,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
priv
->
i_timers
=
0
;
priv
->
i_timers
=
0
;
priv
->
pp_timers
=
NULL
;
priv
->
pp_timers
=
NULL
;
priv
->
i_last_input_id
=
0
;
/* Not very safe, should be removed */
/*
/*
* Initialize hotkey handling
* Initialize hotkey handling
*/
*/
...
...
src/libvlc.h
View file @
dca6b1f8
...
@@ -182,7 +182,6 @@ typedef struct libvlc_priv_t
...
@@ -182,7 +182,6 @@ typedef struct libvlc_priv_t
{
{
libvlc_int_t
public_data
;
libvlc_int_t
public_data
;
int
i_last_input_id
;
///< Last id of input item
bool
playlist_active
;
bool
playlist_active
;
/* Messages */
/* Messages */
...
...
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