Skip to content

Commit

Permalink
add data getter in avio context custom
Browse files Browse the repository at this point in the history
  • Loading branch information
vnghia committed Mar 16, 2024
1 parent 92d9d7d commit e34a83a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/avformat/avio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ impl AVIOContextCustom {
_opaque: opaque,
}
}

// Extract the data passed in `alloc_context`
// and set that data inside it to an empty vec.
pub fn take_data(&mut self) -> Vec<u8> {
std::mem::take(&mut self._opaque.data)
}
}

impl Drop for AVIOContextCustom {
Expand Down

0 comments on commit e34a83a

Please sign in to comment.