perf: prioritize audio preroll after paused network previews
This commit is contained in:
@@ -1117,8 +1117,12 @@ struct Player {
|
||||
bool decodeOne(bool stepping = false) {
|
||||
for (const auto &input : inputs)
|
||||
if (input) check(input->error(), "Reading network media");
|
||||
// Once a paused network preview is shown, finish audio preroll first.
|
||||
// Video remains a fallback so a combined reader can relieve byte pressure.
|
||||
const int firstSlot = network && status == PLAYER_PAUSED && previewShown && !stepping ?
|
||||
0 : nextDecodeSlot;
|
||||
for (int offset = 0; offset < 2; ++offset) {
|
||||
const int slot = (nextDecodeSlot + offset) % 2;
|
||||
const int slot = (firstSlot + offset) % 2;
|
||||
auto &track = tracks[slot];
|
||||
if (!track.codec || track.drained || (stepping && slot == 0)) continue;
|
||||
if (slot == 0 && pcmOffset < pcmFrames) continue;
|
||||
|
||||
Reference in New Issue
Block a user