@@ -203,7 +203,6 @@ struct EnqueuedFrame {
203
203
frame : DecodedFrame ,
204
204
}
205
205
206
-
207
206
impl PartialEq for EnqueuedFrame {
208
207
fn eq ( & self , other : & Self ) -> bool {
209
208
self . composition_time == other. composition_time
@@ -212,7 +211,6 @@ impl PartialEq for EnqueuedFrame {
212
211
213
212
impl Eq for EnqueuedFrame { }
214
213
215
-
216
214
impl Ord for EnqueuedFrame {
217
215
fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
218
216
self . composition_time . cmp ( & other. composition_time ) . reverse ( )
@@ -416,7 +414,6 @@ impl VideoDecoder for H264Decoder {
416
414
}
417
415
418
416
if dest_buf_info. iBufferStatus == 1 {
419
-
420
417
let buffer_info = dest_buf_info. UsrData . sSystemBuffer ;
421
418
if buffer_info. iFormat != videoFormatI420 as c_int {
422
419
return Err ( Error :: DecoderError (
@@ -456,28 +453,23 @@ impl VideoDecoder for H264Decoder {
456
453
// when encoded image size doesn't match declared video tag size.
457
454
// NOTE: This will always use the BT.601 coefficients, which may or may
458
455
// 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
+ } ) ;
472
467
}
473
468
474
469
if self . frame_reorder_queue . len ( ) >= 3 {
475
470
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 ( ) ) )
481
473
}
482
474
}
483
475
}
0 commit comments