Skip to content

Commit

Permalink
Grab location from offer response for use with delete
Browse files Browse the repository at this point in the history
  • Loading branch information
kc5nra committed Dec 15, 2022
1 parent 19710d1 commit 75c1acf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plugins/obs-webrtc/webrtc/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,10 @@ impl OutputStream {
.local_description()
.await
.ok_or_else(|| anyhow!("No local description available"))?;
let answer = whip::offer(url, bearer_token, offer).await?;
self.peer_connection
.set_remote_description(answer.0)
.await?;
let (answer, whip_resource) = whip::offer(url, bearer_token, offer).await?;
self.peer_connection.set_remote_description(answer).await?;

*self.whip_resource.lock().unwrap() = answer.1;
*self.whip_resource.lock().unwrap() = whip_resource;

Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions plugins/obs-webrtc/webrtc/src/whip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub async fn offer(
.send()
.await?;

// Retrieve resource from location and ensure it's non-empty
let whip_resource = res
.headers()
.get(LOCATION)
Expand Down

0 comments on commit 75c1acf

Please sign in to comment.