util/frame: fix cloning

This commit is contained in:
meh
2015-05-31 18:57:37 +02:00
parent 46a5f863c8
commit 97b6100810
3 changed files with 24 additions and 60 deletions

View File

@ -32,18 +32,6 @@ pub struct Frame {
}
impl Frame {
pub fn new() -> Self {
unsafe {
Frame { ptr: av_frame_alloc() }
}
}
pub fn copy(&mut self, source: &Frame) {
unsafe {
av_frame_copy_props(self.ptr, source.ptr);
}
}
pub fn is_key(&self) -> bool {
unsafe {
(*self.ptr).key_frame == 1
@ -141,22 +129,6 @@ impl Frame {
unsafe impl Send for Frame { }
impl Clone for Frame {
fn clone(&self) -> Self {
let mut frame = Frame::new();
frame.clone_from(self);
frame
}
fn clone_from(&mut self, source: &Self) {
unsafe {
av_frame_copy(self.ptr, source.ptr);
av_frame_copy_props(self.ptr, source.ptr);
}
}
}
impl Drop for Frame {
fn drop(&mut self) {
unsafe {