Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
04c94d37
Commit
04c94d37
authored
Nov 11, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: use atomic variable instead of aout lock for statistics
parent
1b57d370
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
14 deletions
+6
-14
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+1
-2
src/audio_output/dec.c
src/audio_output/dec.c
+5
-12
No files found.
src/audio_output/aout_internal.h
View file @
04c94d37
...
...
@@ -75,8 +75,7 @@ typedef struct
aout_request_vout_t
request_vout
;
bool
recycle_vout
;
unsigned
buffers_lost
;
atomic_uint
buffers_lost
;
vlc_atomic_t
restart
;
}
aout_owner_t
;
...
...
src/audio_output/dec.c
View file @
04c94d37
...
...
@@ -96,10 +96,10 @@ error:
date_Init
(
&
owner
->
sync
.
date
,
owner
->
mixer_format
.
i_rate
,
1
);
date_Set
(
&
owner
->
sync
.
date
,
VLC_TS_INVALID
);
owner
->
sync
.
resamp_type
=
AOUT_RESAMPLING_NONE
;
aout_unlock
(
p_aout
);
owner
->
buffers_lost
=
0
;
atomic_init
(
&
owner
->
buffers_lost
,
0
)
;
aout_unlock
(
p_aout
);
return
ret
;
}
...
...
@@ -317,7 +317,7 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate)
block
=
aout_FiltersPlay
(
aout
,
block
,
input_rate
);
if
(
block
==
NULL
)
{
owner
->
buffers_lost
++
;
atomic_fetch_add
(
&
owner
->
buffers_lost
,
1
)
;
goto
out
;
}
...
...
@@ -386,21 +386,14 @@ out:
return
0
;
drop:
block_Release
(
block
);
owner
->
buffers_lost
++
;
atomic_fetch_add
(
&
owner
->
buffers_lost
,
1
)
;
goto
out
;
}
int
aout_DecGetResetLost
(
audio_output_t
*
aout
)
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
unsigned
val
;
aout_lock
(
aout
);
val
=
owner
->
buffers_lost
;
owner
->
buffers_lost
=
0
;
aout_unlock
(
aout
);
return
val
;
return
atomic_exchange
(
&
owner
->
buffers_lost
,
0
);
}
void
aout_DecChangePause
(
audio_output_t
*
aout
,
bool
paused
,
mtime_t
date
)
...
...
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