id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 4931,"When avoiding conflicts with LiveTV, HandleGetNextFreeRecorder iterates through encoders in wrong order",Nick Morrott ,danielk,"When ""Avoid conflicts between live TV and scheduled shows"" is enabled, MainServer::HandleGetNextFreeRecorder seemingly iterates through the available encoders in the wrong order. If the iterator reaches the end of the encoder list, the function resets the iterator to the beginning of the list (mythtv/programs/mythbackend/mainserver.cpp, lines 2755-8), which surely results in returning the *best* encoder available (and therefore most likely to be used for recordings), rather than the next least-worst encoder (which is the next least likely to conflict with scheduled recordings). Because the behaviour does not change whether ""Avoid conflicts between live TV and scheduled shows"" is enabled or not, the only benefit currently seems to be that the *first* card chosen for LiveTV is unlikely to conflict with LiveTV, as MainServer::HandleGetFreeRecorder takes LastFreeCard into account, whereas MainServer::HandleGetNextFreeRecorder does not. As an example, on my system I have 4 currently configured cards. I have 'avoid conflicts' enabled, and if I fire up Live TV I get the last encoder (#4) as expected. If I then choose the next tuner, I would expect to get the next least-worse (#3) but it cycles back to #1 (the best encoder, if available), and then iterates forwards until the end of the list is reached again. ",defect,closed,minor,unknown,mythtv,head,medium,invalid,avoid conflicts live tv,,0