Merge "Fix bug in DemuxResource allocation logic" into main