Fix track dropping code not always dropping the userSelect when it should/could

This commit is contained in:
Thulinma 2024-07-12 13:04:25 +02:00
parent 11f19c77eb
commit c6078afc24

View file

@ -2015,12 +2015,10 @@ namespace Mist{
// depending on whether this is probably bad and the current debug level, print a message
size_t printLevel = (probablyBad ? DLVL_WARN : DLVL_INFO);
//The rest of the operations depends on userSelect, so we ignore it if it doesn't exist.
if (!M || !M.getValidTracks().count(trackId)){
DEBUG_MSG(printLevel, "Dropping invalid track %zu: %s", trackId, reason.c_str());
return;
}
if (!userSelect.count(trackId)){
if (M.hasEmbeddedFrames(trackId)){
if (!M || !M.getValidTracks().count(trackId)){
DEBUG_MSG(printLevel, "Dropping invalid track %zu: %s", trackId, reason.c_str());
}else if (M.hasEmbeddedFrames(trackId)){
DEBUG_MSG(printLevel, "Dropping %s track %zu (raw): %s", meta.getCodec(trackId).c_str(), trackId, reason.c_str());
}else{
DEBUG_MSG(printLevel, "Dropping %s track %zu (lastP=%" PRIu64 "): %s",
@ -2033,12 +2031,20 @@ namespace Mist{
DEBUG_MSG(printLevel, "Dropping %s track %zu (raw): %s", meta.getCodec(trackId).c_str(), trackId, reason.c_str());
}else{
if (!usr){
DEBUG_MSG(printLevel, "Dropping %s track %zu (lastP=%" PRIu64 "): %s",
meta.getCodec(trackId).c_str(), trackId, pageNumMax(trackId), reason.c_str());
if (!M || !M.getValidTracks().count(trackId)){
DEBUG_MSG(printLevel, "Dropping invalid track %zu: %s", trackId, reason.c_str());
}else{
DEBUG_MSG(printLevel, "Dropping %s track %zu (lastP=%" PRIu64 "): %s",
meta.getCodec(trackId).c_str(), trackId, pageNumMax(trackId), reason.c_str());
}
}else{
DEBUG_MSG(printLevel, "Dropping %s track %zu@k%zu (nextP=%" PRIu64 ", lastP=%" PRIu64 "): %s",
meta.getCodec(trackId).c_str(), trackId, usr.getKeyNum() + 1,
pageNumForKey(trackId, usr.getKeyNum() + 1), pageNumMax(trackId), reason.c_str());
if (!M || !M.getValidTracks().count(trackId)){
DEBUG_MSG(printLevel, "Dropping invalid track %zu: %s", trackId, reason.c_str());
}else{
DEBUG_MSG(printLevel, "Dropping %s track %zu@k%zu (nextP=%" PRIu64 ", lastP=%" PRIu64 "): %s",
meta.getCodec(trackId).c_str(), trackId, usr.getKeyNum() + 1,
pageNumForKey(trackId, usr.getKeyNum() + 1), pageNumMax(trackId), reason.c_str());
}
}
}
userSelect.erase(trackId);