webrtc_sendrecv.py: Fix deprecation warning with Python 3.10

asyncio.get_event_loop() will not implicitly create a new event loop
in a future version of Python, so we need to do that explicitly.

```
webrtc_sendrecv.py:188: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1832>
This commit is contained in:
Nirbheek Chauhan 2022-03-01 19:53:41 +05:30 committed by Tim-Philipp Müller
parent d80d9a023b
commit e24e69f81c

View file

@ -185,7 +185,7 @@ if __name__ == '__main__':
args = parser.parse_args()
our_id = random.randrange(10, 10000)
c = WebRTCClient(our_id, args.peerid, args.server)
loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
loop.run_until_complete(c.connect())
res = loop.run_until_complete(c.loop())
sys.exit(res)