gstreamer: error: Prefix gst_error_msg with $crate

This macro might not have been imported in the surrounding scope where
gst_panic_to_error is used, thus reference it directly by the full
namespace.
This commit is contained in:
Marijn Suijten 2020-08-28 20:29:18 +02:00 committed by Sebastian Dröge
parent 5a28412fef
commit 787954eab9

View file

@ -21,7 +21,7 @@ macro_rules! gst_panic_to_error(
#[allow(clippy::unused_unit)]
{
if $panicked.load(Ordering::Relaxed) {
$element.post_error_message(gst_error_msg!($crate::LibraryError::Failed, ["Panicked"]));
$element.post_error_message($crate::gst_error_msg!($crate::LibraryError::Failed, ["Panicked"]));
$ret
} else {
let result = panic::catch_unwind(AssertUnwindSafe(|| $code));
@ -31,11 +31,11 @@ macro_rules! gst_panic_to_error(
Err(err) => {
$panicked.store(true, Ordering::Relaxed);
if let Some(cause) = err.downcast_ref::<&str>() {
$element.post_error_message(gst_error_msg!($crate::LibraryError::Failed, ["Panicked: {}", cause]));
$element.post_error_message($crate::gst_error_msg!($crate::LibraryError::Failed, ["Panicked: {}", cause]));
} else if let Some(cause) = err.downcast_ref::<String>() {
$element.post_error_message(gst_error_msg!($crate::LibraryError::Failed, ["Panicked: {}", cause]));
$element.post_error_message($crate::gst_error_msg!($crate::LibraryError::Failed, ["Panicked: {}", cause]));
} else {
$element.post_error_message(gst_error_msg!($crate::LibraryError::Failed, ["Panicked"]));
$element.post_error_message($crate::gst_error_msg!($crate::LibraryError::Failed, ["Panicked"]));
}
$ret
}