Commit 3a19dd35 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

clarify bitrate checking includes upper bitrate in bitrate-switching tests

parent 0ec3aa83
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -928,12 +928,17 @@ class MLDConformance:
        return self.analyseOneCommand(*args)

    def _extractKbpsValues(self, rawCmdline: str) -> list[float]:
        """Extract all bitrate values from command line (e.g., from 'at_32_kbps' or 'from_32_kbps_to_96_kbps')."""
        values = []
        for match in re.findall(r"(\d+(?:_\d+)?)_kbps", rawCmdline.lower()):
            values.append(float(match.replace("_", ".")))
        return values

    def _isBitrateAtMost80(self, rawCmdline: str) -> bool:
        """Check if all bitrates in command line are <= 80 kbps.
        
        For bitrate switching tests (e.g., 'from_32_kbps_to_96_kbps'), this checks 
        that the upper (target) bitrate does not exceed 80 kbps."""
        values = self._extractKbpsValues(rawCmdline)
        return bool(values) and max(values) <= 80.0

@@ -1935,5 +1940,5 @@ if __name__ == "__main__":
        for tag in testTags:
            tag_status = "OK" if tag_results.get(tag, False) else "FAILED"
            print(f"[{tag}] {tag_status}")
        print("\n")
        print()