mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
gstreamer/sdp: Fix SDPMessage::medias_mut() iterator
The raw pointer manipulation code was adding one indirection too many. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/304
This commit is contained in:
parent
8549046994
commit
08c54145d3
1 changed files with 3 additions and 3 deletions
|
@ -1029,7 +1029,7 @@ macro_rules! define_iter_mut(
|
||||||
// example removes the message that was returned here at an earlier time. The compiler
|
// example removes the message that was returned here at an earlier time. The compiler
|
||||||
// would be correct to complain in that case, but we don't provide such a function.
|
// would be correct to complain in that case, but we don't provide such a function.
|
||||||
let message = unsafe {
|
let message = unsafe {
|
||||||
&mut *(&mut self.message as *mut &'a mut SDPMessageRef as *mut SDPMessageRef)
|
&mut *(self.message as *mut SDPMessageRef)
|
||||||
};
|
};
|
||||||
if self.idx >= self.len {
|
if self.idx >= self.len {
|
||||||
return None;
|
return None;
|
||||||
|
@ -1054,7 +1054,7 @@ macro_rules! define_iter_mut(
|
||||||
impl<'a> DoubleEndedIterator for $name<'a> {
|
impl<'a> DoubleEndedIterator for $name<'a> {
|
||||||
fn next_back(&mut self) -> Option<Self::Item> {
|
fn next_back(&mut self) -> Option<Self::Item> {
|
||||||
let message = unsafe {
|
let message = unsafe {
|
||||||
&mut *(&mut self.message as *mut &'a mut SDPMessageRef as *mut SDPMessageRef)
|
&mut *(self.message as *mut SDPMessageRef)
|
||||||
};
|
};
|
||||||
if self.idx == self.len {
|
if self.idx == self.len {
|
||||||
return None;
|
return None;
|
||||||
|
@ -1098,7 +1098,7 @@ define_iter_mut!(
|
||||||
MediasIterMut,
|
MediasIterMut,
|
||||||
&'a mut SDPMediaRef,
|
&'a mut SDPMediaRef,
|
||||||
|message: &'a mut SDPMessageRef, idx| message.get_media_mut(idx),
|
|message: &'a mut SDPMessageRef, idx| message.get_media_mut(idx),
|
||||||
|message: &mut SDPMessageRef| message.medias_len()
|
|message: &SDPMessageRef| message.medias_len()
|
||||||
);
|
);
|
||||||
define_iter!(
|
define_iter!(
|
||||||
PhonesIter,
|
PhonesIter,
|
||||||
|
|
Loading…
Reference in a new issue