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
Steve Lhomme
VLC
Commits
04c94d37
Commit
04c94d37
authored
Nov 11, 2012
by
Rémi Denis-Courmont
Browse files
aout: use atomic variable instead of aout lock for statistics
parent
1b57d370
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/audio_output/aout_internal.h
View file @
04c94d37
...
@@ -75,8 +75,7 @@ typedef struct
...
@@ -75,8 +75,7 @@ typedef struct
aout_request_vout_t
request_vout
;
aout_request_vout_t
request_vout
;
bool
recycle_vout
;
bool
recycle_vout
;
unsigned
buffers_lost
;
atomic_uint
buffers_lost
;
vlc_atomic_t
restart
;
vlc_atomic_t
restart
;
}
aout_owner_t
;
}
aout_owner_t
;
...
...
src/audio_output/dec.c
View file @
04c94d37
...
@@ -96,10 +96,10 @@ error:
...
@@ -96,10 +96,10 @@ error:
date_Init
(
&
owner
->
sync
.
date
,
owner
->
mixer_format
.
i_rate
,
1
);
date_Init
(
&
owner
->
sync
.
date
,
owner
->
mixer_format
.
i_rate
,
1
);
date_Set
(
&
owner
->
sync
.
date
,
VLC_TS_INVALID
);
date_Set
(
&
owner
->
sync
.
date
,
VLC_TS_INVALID
);
owner
->
sync
.
resamp_type
=
AOUT_RESAMPLING_NONE
;
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
;
return
ret
;
}
}
...
@@ -317,7 +317,7 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate)
...
@@ -317,7 +317,7 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate)
block
=
aout_FiltersPlay
(
aout
,
block
,
input_rate
);
block
=
aout_FiltersPlay
(
aout
,
block
,
input_rate
);
if
(
block
==
NULL
)
if
(
block
==
NULL
)
{
{
owner
->
buffers_lost
++
;
atomic_fetch_add
(
&
owner
->
buffers_lost
,
1
)
;
goto
out
;
goto
out
;
}
}
...
@@ -386,21 +386,14 @@ out:
...
@@ -386,21 +386,14 @@ out:
return
0
;
return
0
;
drop:
drop:
block_Release
(
block
);
block_Release
(
block
);
owner
->
buffers_lost
++
;
atomic_fetch_add
(
&
owner
->
buffers_lost
,
1
)
;
goto
out
;
goto
out
;
}
}
int
aout_DecGetResetLost
(
audio_output_t
*
aout
)
int
aout_DecGetResetLost
(
audio_output_t
*
aout
)
{
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
aout_owner_t
*
owner
=
aout_owner
(
aout
);
unsigned
val
;
return
atomic_exchange
(
&
owner
->
buffers_lost
,
0
);
aout_lock
(
aout
);
val
=
owner
->
buffers_lost
;
owner
->
buffers_lost
=
0
;
aout_unlock
(
aout
);
return
val
;
}
}
void
aout_DecChangePause
(
audio_output_t
*
aout
,
bool
paused
,
mtime_t
date
)
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