File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 66
66
mitm = false
67
67
68
68
# Force DPI
69
- # dpi = 130
69
+ # 0 = don't change DPI
70
+ dpi = 0
70
71
71
72
# remove tap restriction
72
73
remove_tap_restriction = false
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ pub async fn io_loop(
198
198
tcp_start : Arc < Notify > ,
199
199
read_timeout : Duration ,
200
200
mitm : bool ,
201
- dpi : Option < u16 > ,
201
+ dpi : u16 ,
202
202
developer_mode : bool ,
203
203
disable_media_sink : bool ,
204
204
disable_tts_sink : bool ,
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ pub struct AppConfig {
148
148
timeout_secs : u16 ,
149
149
bt_timeout_secs : u16 ,
150
150
mitm : bool ,
151
- dpi : Option < u16 > ,
151
+ dpi : u16 ,
152
152
remove_tap_restriction : bool ,
153
153
video_in_motion : bool ,
154
154
disable_media_sink : bool ,
@@ -183,7 +183,7 @@ impl Default for AppConfig {
183
183
timeout_secs : 10 ,
184
184
bt_timeout_secs : 120 ,
185
185
mitm : false ,
186
- dpi : None ,
186
+ dpi : 0 ,
187
187
remove_tap_restriction : false ,
188
188
video_in_motion : false ,
189
189
disable_media_sink : false ,
Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ pub async fn pkt_debug(
262
262
pub async fn pkt_modify_hook (
263
263
proxy_type : ProxyType ,
264
264
pkt : & mut Packet ,
265
- dpi : Option < u16 > ,
265
+ dpi : u16 ,
266
266
developer_mode : bool ,
267
267
disable_media_sink : bool ,
268
268
disable_tts_sink : bool ,
@@ -352,7 +352,7 @@ pub async fn pkt_modify_hook(
352
352
let mut msg = ServiceDiscoveryResponse :: parse_from_bytes ( data) ?;
353
353
354
354
// DPI
355
- if let Some ( new_dpi ) = dpi {
355
+ if dpi > 0 {
356
356
if let Some ( svc) = msg
357
357
. services
358
358
. iter_mut ( )
@@ -362,13 +362,13 @@ pub async fn pkt_modify_hook(
362
362
let prev_val = svc. media_sink_service . video_configs [ 0 ] . density ( ) ;
363
363
// set new value
364
364
svc. media_sink_service . as_mut ( ) . unwrap ( ) . video_configs [ 0 ]
365
- . set_density ( new_dpi . into ( ) ) ;
365
+ . set_density ( dpi . into ( ) ) ;
366
366
info ! (
367
367
"{} <yellow>{:?}</>: replacing DPI value: from <b>{}</> to <b>{}</>" ,
368
368
get_name( proxy_type) ,
369
369
control. unwrap( ) ,
370
370
prev_val,
371
- new_dpi
371
+ dpi
372
372
) ;
373
373
}
374
374
}
@@ -650,7 +650,7 @@ pub async fn proxy<A: Endpoint<A> + 'static>(
650
650
tx : Sender < Packet > ,
651
651
mut rx : Receiver < Packet > ,
652
652
mut rxr : Receiver < Packet > ,
653
- dpi : Option < u16 > ,
653
+ dpi : u16 ,
654
654
developer_mode : bool ,
655
655
disable_media_sink : bool ,
656
656
disable_tts_sink : bool ,
You can’t perform that action at this time.
0 commit comments