LibMedia: Only clear decoder thread queues if the demuxer seek moves
Clearing the queue unconditionally here isn't right, since we could end up with the prior frame to the target in the queue rather than being decoded by handle_seek().
This commit is contained in:
parent
5d1dfec680
commit
020fe311d8
2 changed files with 8 additions and 4 deletions
|
|
@ -407,10 +407,12 @@ DecoderErrorOr<void> DecodedAudioProducer::ThreadData::retrieve_next_block(Audio
|
|||
|
||||
void DecodedAudioProducer::ThreadData::resolve_seek(u32 seek_id, bool moved_position)
|
||||
{
|
||||
m_queue.clear();
|
||||
m_last_processed_seek_id = seek_id;
|
||||
VERIFY(m_current_halting_status != PipelineStatus::HaveData);
|
||||
m_moved_position_pending = moved_position;
|
||||
if (moved_position) {
|
||||
m_moved_position_pending = true;
|
||||
m_queue.clear();
|
||||
}
|
||||
}
|
||||
|
||||
bool DecodedAudioProducer::ThreadData::handle_seek()
|
||||
|
|
|
|||
|
|
@ -393,10 +393,12 @@ void DecodedVideoProducer::ThreadData::dispatch_error(DecoderError&& error)
|
|||
|
||||
void DecodedVideoProducer::ThreadData::resolve_seek(u32 seek_id, bool moved_position)
|
||||
{
|
||||
m_queue.clear();
|
||||
m_last_processed_seek_id = seek_id;
|
||||
VERIFY(m_current_halting_status != PipelineStatus::HaveData);
|
||||
m_moved_position_pending = moved_position;
|
||||
if (moved_position) {
|
||||
m_moved_position_pending = true;
|
||||
m_queue.clear();
|
||||
}
|
||||
}
|
||||
|
||||
bool DecodedVideoProducer::ThreadData::handle_seek()
|
||||
|
|
|
|||
Loading…
Reference in a new issue