[vlc-commits] aout: remove input.b_paused (use VLC_TS_INVALID pause date)
Rémi Denis-Courmont
git at videolan.org
Mon Aug 1 22:21:20 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 1 23:21:01 2011 +0300| [fe805f7ba65ca13f632b7442d21acc003d6d651b] | committer: Rémi Denis-Courmont
aout: remove input.b_paused (use VLC_TS_INVALID pause date)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe805f7ba65ca13f632b7442d21acc003d6d651b
---
src/audio_output/aout_internal.h | 1 -
src/audio_output/dec.c | 21 ++++++++++-----------
src/audio_output/input.c | 2 --
3 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 2a48a53..9fdf512 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -85,7 +85,6 @@ struct aout_input_t
int i_buffer_lost;
/* */
- bool b_paused;
mtime_t i_pause_date;
/* */
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 7cf79aa..21edfca 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -82,8 +82,7 @@ aout_input_t *aout_DecNew( audio_output_t *p_aout,
return NULL;
p_input->b_error = true;
- p_input->b_paused = false;
- p_input->i_pause_date = 0;
+ p_input->i_pause_date = VLC_TS_INVALID;
aout_FormatPrepare( p_format );
@@ -223,23 +222,23 @@ int aout_DecGetResetLost( audio_output_t *p_aout, aout_input_t *p_input )
void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_paused, mtime_t i_date )
{
- mtime_t i_duration = 0;
-
aout_lock( p_aout );
assert( p_aout->p_input == p_input );
- assert( !p_input->b_paused || !b_paused );
- if( p_input->b_paused )
+
+ if( b_paused )
{
- i_duration = i_date - p_input->i_pause_date;
+ p_input->i_pause_date = i_date;
}
- p_input->b_paused = b_paused;
- p_input->i_pause_date = i_date;
-
- if( i_duration != 0 )
+ else
{
+ assert( p_input->i_pause_date != VLC_TS_INVALID );
+
+ mtime_t i_duration = i_date - p_input->i_pause_date;
+ p_input->i_pause_date = VLC_TS_INVALID;
aout_FifoMoveDates( &p_input->fifo, i_duration );
aout_FifoMoveDates( &p_aout->fifo, i_duration );
}
+
aout_OutputPause( p_aout, b_paused, i_date );
aout_unlock( p_aout );
}
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index d2e10ec..70c581a 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -466,7 +466,6 @@ void aout_InputCheckAndRestart( audio_output_t * p_aout, aout_input_t * p_input
/* A little trick to avoid loosing our input fifo and properties */
aout_fifo_t fifo = p_input->fifo;
- bool b_paused = p_input->b_paused;
mtime_t i_pause_date = p_input->i_pause_date;
aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer_format.i_rate );
@@ -475,7 +474,6 @@ void aout_InputCheckAndRestart( audio_output_t * p_aout, aout_input_t * p_input
aout_InputNew( p_aout, p_input, &p_input->request_vout );
p_input->fifo = fifo;
- p_input->b_paused = b_paused;
p_input->i_pause_date = i_pause_date;
p_input->b_restart = false;
More information about the vlc-commits
mailing list