mirror of https://code.videolan.org/videolan/vlc
aout: move first_pts init in stream_Synchronize
And share the same lock instance. timing.first_pts is now only valid when using timing_report (stream->timing struct should not be used when using time_get)
This commit is contained in:
parent
71eec7349f
commit
0587956a91
|
@ -628,6 +628,10 @@ static void stream_Synchronize(vlc_aout_stream *stream, vlc_tick_t system_now,
|
|||
stream->timing.rate_audio_ts = dec_pts;
|
||||
stream->timing.rate = stream->sync.rate;
|
||||
}
|
||||
|
||||
if (stream->timing.first_pts == VLC_TICK_INVALID)
|
||||
stream->timing.first_pts = dec_pts;
|
||||
|
||||
bool is_drifting = stream->timing.last_drift != VLC_TICK_INVALID;
|
||||
vlc_mutex_unlock(&stream->timing.lock);
|
||||
|
||||
|
@ -784,13 +788,6 @@ int vlc_aout_stream_Play(vlc_aout_stream *stream, block_t *block)
|
|||
|
||||
vlc_audio_meter_Process(&owner->meter, block, play_date);
|
||||
|
||||
if (stream->timing.first_pts == VLC_TICK_INVALID)
|
||||
{
|
||||
vlc_mutex_lock(&stream->timing.lock);
|
||||
stream->timing.first_pts = block->i_pts;
|
||||
vlc_mutex_unlock(&stream->timing.lock);
|
||||
}
|
||||
|
||||
/* Output */
|
||||
stream->sync.discontinuity = false;
|
||||
stream->timing.played_samples += block->i_nb_samples;
|
||||
|
|
Loading…
Reference in New Issue