diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 83dee5c8f..ff213ae87 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -35,6 +35,7 @@ Features: Fixes: - Add ``cython.final`` to leaf classes, ensuring that they are not subclassed. - Warn that ``CodecContext.decode()`` is not memory safe in some cases. +- Fix ``enumerate_input_devices`` and ``enumerate_output_devices`` raising ``AttributeError`` (:issue:`2264`). v17.0.1 ------- diff --git a/av/device.py b/av/device.py index 7be7e68a6..9868f1565 100644 --- a/av/device.py +++ b/av/device.py @@ -55,14 +55,12 @@ def _build_device_list(device_list: cython.pointer[lib.AVDeviceInfoList]) -> lis mt = device_info.media_types[j] s = lib.av_get_media_type_string(mt) if s: - media_types.append(s.decode()) + media_types.append(s) devices.append( DeviceInfo( - name=device_info.device_name.decode() - if device_info.device_name - else "", - description=device_info.device_description.decode() + name=device_info.device_name if device_info.device_name else "", + description=device_info.device_description if device_info.device_description else "", is_default=(i == device_list.default_device),