forked from premiere/premiere-libtorrent
fix related to piece priorities
This commit is contained in:
parent
00a7546f7e
commit
10da416c76
|
@ -546,15 +546,19 @@ namespace libtorrent
|
||||||
m_downloads.erase(i);
|
m_downloads.erase(i);
|
||||||
|
|
||||||
piece_pos& p = m_piece_map[index];
|
piece_pos& p = m_piece_map[index];
|
||||||
int priority = p.priority(m_sequenced_download_threshold);
|
int prev_priority = p.priority(m_sequenced_download_threshold);
|
||||||
p.downloading = 0;
|
p.downloading = 0;
|
||||||
if (priority == 0)
|
int new_priority = p.priority(m_sequenced_download_threshold);
|
||||||
|
|
||||||
|
if (new_priority == prev_priority) return;
|
||||||
|
|
||||||
|
if (prev_priority == 0)
|
||||||
{
|
{
|
||||||
add(index);
|
add(index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
move(priority, p.index);
|
move(prev_priority, p.index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue