Skip to content
This repository was archived by the owner on Nov 18, 2019. It is now read-only.

Update Packet API to latest #42

Merged
merged 1 commit into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c-examples/simple_encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main(int argc, char **argv)
printf("Unable to receive packet %d\n", i);
goto clean;
} else if (ret == 0) {
printf("Packet %"PRIu64"\n", p->number);
printf("Packet %"PRIu64"\n", p->input_frameno);
rav1e_packet_unref(p);
i++;
} else if (ret == RA_ENCODER_STATUS_LIMIT_REACHED) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub struct Packet {
/// Encoded data buffer size
pub len: size_t,
/// Frame sequence number
pub number: u64,
pub input_frameno: u64,
/// Frame type
pub frame_type: FrameType,
}
Expand Down Expand Up @@ -427,13 +427,13 @@ pub unsafe extern "C" fn rav1e_receive_packet(
.ctx
.receive_packet()
.map(|p| {
let rav1e::Packet { data, number, frame_type, .. } = p;
let rav1e::Packet { data, input_frameno, frame_type, .. } = p;
let len = data.len();
let data = Box::into_raw(data.into_boxed_slice()) as *const u8;
let packet = Packet {
data,
len,
number,
input_frameno,
frame_type,
};
*pkt = Box::into_raw(Box::new(packet));
Expand Down