mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
ptp: Correctly parse clock ID from the commandline parameters in the helper
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2652 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4806>
This commit is contained in:
parent
d955623afd
commit
2ef261557d
1 changed files with 5 additions and 1 deletions
|
@ -44,7 +44,11 @@ pub fn parse_args() -> Result<Args, Error> {
|
|||
}
|
||||
"-c" | "--clock-id" => {
|
||||
let clock_id_arg = args.next().context("No clock-id following -c")?;
|
||||
clock_id = clock_id_arg.parse::<u64>().context("Invalid clock ID")?;
|
||||
if !clock_id_arg.starts_with("0x") && !clock_id_arg.starts_with("0X") {
|
||||
bail!("Clock ID not starting with 0x");
|
||||
}
|
||||
clock_id =
|
||||
u64::from_str_radix(&clock_id_arg[2..], 16).context("Invalid clock ID")?;
|
||||
}
|
||||
arg => {
|
||||
bail!("Unknown command-line argument {}", arg);
|
||||
|
|
Loading…
Reference in a new issue