Mant thanks, will try it.
1000 is some limit or if I will use 10000 will it be no problem? I think if it is not DLNA violation or if bigger number = slower listing or if TV will not ask again and again when starting index will be much smaller also in case numberreturned will be 0. But this I will se when I will compile it
Will let you know.
Anyway you are talking about cheating but it seems TV don't like also DLNA specification TotalMatches=0, quite bad
EDIT:I maybe found root cause why it is happening. TV shows total number of files when every folder browsed.
This number is stored and taken as fixed so when scrolled to 21st file, PMS sends next 20 but TV tries to go back to first one because current position is 20, fixed number is 20 so go down action on TV tries to go back to first one so it asks again for startindex 0, requestedcount 20 also at time when PMS sends next startindex and another 20 files. At this point it will stuck again.
Stupid function, not dlna compliant

Theoretically in this case fixed TotalMatches should work(I suppose "go up when currently at bottom" function will stop to work

). Will test tomorrow and let you know.
So first answer to the TV with fake TotalMatches=1000 and all other responses with non-fake TotalMatches should work (if it will be "real" one or "startingindex + requestcount + 1")