Skip to content

Commit 642c69c

Browse files
committed
cargo fmt
1 parent 59d4f9b commit 642c69c

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

video/external/src/decoder/openh264.rs

+13-21
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ struct EnqueuedFrame {
203203
frame: DecodedFrame,
204204
}
205205

206-
207206
impl PartialEq for EnqueuedFrame {
208207
fn eq(&self, other: &Self) -> bool {
209208
self.composition_time == other.composition_time
@@ -212,7 +211,6 @@ impl PartialEq for EnqueuedFrame {
212211

213212
impl Eq for EnqueuedFrame {}
214213

215-
216214
impl Ord for EnqueuedFrame {
217215
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
218216
self.composition_time.cmp(&other.composition_time).reverse()
@@ -416,7 +414,6 @@ impl VideoDecoder for H264Decoder {
416414
}
417415

418416
if dest_buf_info.iBufferStatus == 1 {
419-
420417
let buffer_info = dest_buf_info.UsrData.sSystemBuffer;
421418
if buffer_info.iFormat != videoFormatI420 as c_int {
422419
return Err(Error::DecoderError(
@@ -456,28 +453,23 @@ impl VideoDecoder for H264Decoder {
456453
// when encoded image size doesn't match declared video tag size.
457454
// NOTE: This will always use the BT.601 coefficients, which may or may
458455
// not be correct. So far I haven't seen anything to the contrary in FP.
459-
self.frame_reorder_queue.push(
460-
EnqueuedFrame {
461-
composition_time: encoded_frame.composition_time.ok_or(
462-
Error::DecoderError("No composition time provided".into()),
463-
)?,
464-
frame: DecodedFrame::new(
465-
buffer_info.iWidth as u32,
466-
buffer_info.iHeight as u32,
467-
BitmapFormat::Yuv420p,
468-
yuv,
469-
),
470-
}
471-
);
456+
self.frame_reorder_queue.push(EnqueuedFrame {
457+
composition_time: encoded_frame
458+
.composition_time
459+
.ok_or(Error::DecoderError("No composition time provided".into()))?,
460+
frame: DecodedFrame::new(
461+
buffer_info.iWidth as u32,
462+
buffer_info.iHeight as u32,
463+
BitmapFormat::Yuv420p,
464+
yuv,
465+
),
466+
});
472467
}
473468

474469
if self.frame_reorder_queue.len() >= 3 {
475470
Ok(self.frame_reorder_queue.pop().unwrap().frame)
476-
}
477-
else {
478-
Err(Error::DecoderError(
479-
"Not enough frames decoded yet".into(),
480-
))
471+
} else {
472+
Err(Error::DecoderError("Not enough frames decoded yet".into()))
481473
}
482474
}
483475
}

0 commit comments

Comments
 (0)