Skip to content

Commit 6caba4d

Browse files
authored
Merge pull request #65 from rgon/fix/hw_accel_list_available
2 parents 5ecd2b5 + 5905943 commit 6caba4d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ffi_hwaccel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ pub fn hwdevice_list_available_device_types() -> Vec<HardwareAccelerationDeviceT
4545
ffmpeg::ffi::av_hwdevice_iterate_types(ffmpeg::ffi::AVHWDeviceType::AV_HWDEVICE_TYPE_NONE)
4646
};
4747
while hwdevice_type != ffmpeg::ffi::AVHWDeviceType::AV_HWDEVICE_TYPE_NONE {
48-
hwdevice_types.push(HardwareAccelerationDeviceType::from(hwdevice_type).unwrap());
48+
if let Some(device_type) = HardwareAccelerationDeviceType::from(hwdevice_type) {
49+
hwdevice_types.push(device_type);
50+
}
4951
hwdevice_type = unsafe { ffmpeg::ffi::av_hwdevice_iterate_types(hwdevice_type) };
5052
}
5153
hwdevice_types

src/hwaccel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl HardwareAccelerationDeviceType {
9393
// FIXME: Find a way to handle the new variants in ffmpeg 7 without breaking backwards
9494
// compatibility...
9595
#[allow(unreachable_patterns)]
96-
_ => unimplemented!(),
96+
_ => None
9797
}
9898
}
9999
}

0 commit comments

Comments
 (0)