@@ -53,16 +53,14 @@ unsafe fn validate_ms_decoder(st: *mut OpusMSDecoder) {
53
53
validate_layout ( & mut ( * st) . layout ) ;
54
54
}
55
55
pub unsafe fn opus_multistream_decoder_get_size ( nb_streams : i32 , nb_coupled_streams : i32 ) -> i32 {
56
- let mut coupled_size: i32 = 0 ;
57
- let mut mono_size: i32 = 0 ;
58
56
if nb_streams < 1 || nb_coupled_streams > nb_streams || nb_coupled_streams < 0 {
59
57
return 0 ;
60
58
}
61
- coupled_size = opus_decoder_get_size ( 2 ) ;
62
- mono_size = opus_decoder_get_size ( 1 ) ;
59
+ let coupled_size = opus_decoder_get_size ( 2 ) ;
60
+ let mono_size = opus_decoder_get_size ( 1 ) ;
63
61
return align ( :: core:: mem:: size_of :: < OpusMSDecoder > ( ) as u64 as i32 )
64
- + nb_coupled_streams * align ( coupled_size)
65
- + ( nb_streams - nb_coupled_streams) * align ( mono_size) ;
62
+ + nb_coupled_streams * align ( coupled_size as _ )
63
+ + ( nb_streams - nb_coupled_streams) * align ( mono_size as _ ) ;
66
64
}
67
65
pub unsafe fn opus_multistream_decoder_init (
68
66
st : * mut OpusMSDecoder ,
@@ -72,8 +70,6 @@ pub unsafe fn opus_multistream_decoder_init(
72
70
coupled_streams : i32 ,
73
71
mapping : * const u8 ,
74
72
) -> i32 {
75
- let mut coupled_size: i32 = 0 ;
76
- let mut mono_size: i32 = 0 ;
77
73
let mut i: i32 = 0 ;
78
74
let mut ret: i32 = 0 ;
79
75
let mut ptr: * mut i8 = 0 as * mut i8 ;
@@ -99,23 +95,23 @@ pub unsafe fn opus_multistream_decoder_init(
99
95
}
100
96
ptr = ( st as * mut i8 )
101
97
. offset ( align ( :: core:: mem:: size_of :: < OpusMSDecoder > ( ) as u64 as i32 ) as isize ) ;
102
- coupled_size = opus_decoder_get_size ( 2 ) ;
103
- mono_size = opus_decoder_get_size ( 1 ) ;
98
+ let coupled_size = opus_decoder_get_size ( 2 ) ;
99
+ let mono_size = opus_decoder_get_size ( 1 ) ;
104
100
i = 0 ;
105
101
while i < ( * st) . layout . nb_coupled_streams {
106
102
ret = opus_decoder_init ( ptr as * mut OpusDecoder , Fs , 2 ) ;
107
103
if ret != OPUS_OK {
108
104
return ret;
109
105
}
110
- ptr = ptr. offset ( align ( coupled_size) as isize ) ;
106
+ ptr = ptr. offset ( align ( coupled_size as _ ) as isize ) ;
111
107
i += 1 ;
112
108
}
113
109
while i < ( * st) . layout . nb_streams {
114
110
ret = opus_decoder_init ( ptr as * mut OpusDecoder , Fs , 1 ) ;
115
111
if ret != OPUS_OK {
116
112
return ret;
117
113
}
118
- ptr = ptr. offset ( align ( mono_size) as isize ) ;
114
+ ptr = ptr. offset ( align ( mono_size as _ ) as isize ) ;
119
115
i += 1 ;
120
116
}
121
117
return OPUS_OK ;
@@ -214,8 +210,6 @@ pub unsafe fn opus_multistream_decode_native(
214
210
user_data : * mut core:: ffi:: c_void ,
215
211
) -> i32 {
216
212
let mut Fs : i32 = 0 ;
217
- let mut coupled_size: i32 = 0 ;
218
- let mut mono_size: i32 = 0 ;
219
213
let mut s: i32 = 0 ;
220
214
let mut c: i32 = 0 ;
221
215
let mut ptr: * mut i8 = 0 as * mut i8 ;
@@ -234,8 +228,8 @@ pub unsafe fn opus_multistream_decode_native(
234
228
let mut buf: Vec < opus_val16 > = :: std:: vec:: from_elem ( 0. , vla) ;
235
229
ptr = ( st as * mut i8 )
236
230
. offset ( align ( :: core:: mem:: size_of :: < OpusMSDecoder > ( ) as u64 as i32 ) as isize ) ;
237
- coupled_size = opus_decoder_get_size ( 2 ) ;
238
- mono_size = opus_decoder_get_size ( 1 ) ;
231
+ let coupled_size = opus_decoder_get_size ( 2 ) ;
232
+ let mono_size = opus_decoder_get_size ( 1 ) ;
239
233
if len == 0 {
240
234
do_plc = 1 ;
241
235
}
@@ -263,9 +257,9 @@ pub unsafe fn opus_multistream_decode_native(
263
257
dec = ptr as * mut OpusDecoder ;
264
258
ptr = ptr. offset (
265
259
( if s < ( * st) . layout . nb_coupled_streams {
266
- align ( coupled_size)
260
+ align ( coupled_size as _ )
267
261
} else {
268
- align ( mono_size)
262
+ align ( mono_size as _ )
269
263
} ) as isize ,
270
264
) ;
271
265
if do_plc == 0 && len <= 0 {
@@ -492,12 +486,10 @@ pub unsafe fn opus_multistream_decoder_ctl_va_list(
492
486
mut ap : VarArgs ,
493
487
) -> i32 {
494
488
let current_block: u64 ;
495
- let mut coupled_size: i32 = 0 ;
496
- let mut mono_size: i32 = 0 ;
497
489
let mut ptr: * mut i8 = 0 as * mut i8 ;
498
490
let mut ret: i32 = OPUS_OK ;
499
- coupled_size = opus_decoder_get_size ( 2 ) ;
500
- mono_size = opus_decoder_get_size ( 1 ) ;
491
+ let coupled_size = opus_decoder_get_size ( 2 ) ;
492
+ let mono_size = opus_decoder_get_size ( 1 ) ;
501
493
ptr = ( st as * mut i8 )
502
494
. offset ( align ( :: core:: mem:: size_of :: < OpusMSDecoder > ( ) as u64 as i32 ) as isize ) ;
503
495
match request {
@@ -522,9 +514,9 @@ pub unsafe fn opus_multistream_decoder_ctl_va_list(
522
514
let mut dec_0: * mut OpusDecoder = 0 as * mut OpusDecoder ;
523
515
dec_0 = ptr as * mut OpusDecoder ;
524
516
if s < ( * st) . layout . nb_coupled_streams {
525
- ptr = ptr. offset ( align ( coupled_size) as isize ) ;
517
+ ptr = ptr. offset ( align ( coupled_size as _ ) as isize ) ;
526
518
} else {
527
- ptr = ptr. offset ( align ( mono_size) as isize ) ;
519
+ ptr = ptr. offset ( align ( mono_size as _ ) as isize ) ;
528
520
}
529
521
ret = opus_decoder_ctl ! ( dec_0, request, & mut tmp) ;
530
522
if ret != OPUS_OK {
@@ -542,9 +534,9 @@ pub unsafe fn opus_multistream_decoder_ctl_va_list(
542
534
let mut dec_1: * mut OpusDecoder = 0 as * mut OpusDecoder ;
543
535
dec_1 = ptr as * mut OpusDecoder ;
544
536
if s_0 < ( * st) . layout . nb_coupled_streams {
545
- ptr = ptr. offset ( align ( coupled_size) as isize ) ;
537
+ ptr = ptr. offset ( align ( coupled_size as _ ) as isize ) ;
546
538
} else {
547
- ptr = ptr. offset ( align ( mono_size) as isize ) ;
539
+ ptr = ptr. offset ( align ( mono_size as _ ) as isize ) ;
548
540
}
549
541
ret = opus_decoder_ctl ! ( dec_1, OPUS_RESET_STATE ) ;
550
542
if ret != OPUS_OK {
@@ -566,9 +558,9 @@ pub unsafe fn opus_multistream_decoder_ctl_va_list(
566
558
s_1 = 0 ;
567
559
while s_1 < stream_id {
568
560
if s_1 < ( * st) . layout . nb_coupled_streams {
569
- ptr = ptr. offset ( align ( coupled_size) as isize ) ;
561
+ ptr = ptr. offset ( align ( coupled_size as _ ) as isize ) ;
570
562
} else {
571
- ptr = ptr. offset ( align ( mono_size) as isize ) ;
563
+ ptr = ptr. offset ( align ( mono_size as _ ) as isize ) ;
572
564
}
573
565
s_1 += 1 ;
574
566
}
@@ -584,9 +576,9 @@ pub unsafe fn opus_multistream_decoder_ctl_va_list(
584
576
let mut dec_2: * mut OpusDecoder = 0 as * mut OpusDecoder ;
585
577
dec_2 = ptr as * mut OpusDecoder ;
586
578
if s_2 < ( * st) . layout . nb_coupled_streams {
587
- ptr = ptr. offset ( align ( coupled_size) as isize ) ;
579
+ ptr = ptr. offset ( align ( coupled_size as _ ) as isize ) ;
588
580
} else {
589
- ptr = ptr. offset ( align ( mono_size) as isize ) ;
581
+ ptr = ptr. offset ( align ( mono_size as _ ) as isize ) ;
590
582
}
591
583
ret = opus_decoder_ctl ! ( dec_2, request, value_2) ;
592
584
if ret != OPUS_OK {
0 commit comments