Skip to content

Commit

Permalink
Revert changes in goodbye
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-tworek committed Nov 24, 2023
1 parent 604d470 commit edd44f6
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions common/src/rtcp/goodbye.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
use std::time::Duration;

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Goodbye {
pub sources: Vec<u32>,
pub reason: String,
pub timestamp: Duration,
}

#[cfg(not(target_arch = "wasm32"))]
impl Goodbye {
pub fn new(goodbye: &rtcp::goodbye::Goodbye, packet: &Packet) -> Self {
let reason = std::str::from_utf8(&goodbye.reason[..])
.unwrap()
.to_string();
pub fn new(packet: &rtcp::goodbye::Goodbye) -> Self {
let reason = std::str::from_utf8(&packet.reason[..]).unwrap().to_string();

Self {
sources: goodbye.sources.clone(),
sources: packet.sources.clone(),
reason,
timestamp: packet.timestamp,
}
}
}

0 comments on commit edd44f6

Please sign in to comment.