uriplaylistbin: display invalid state when panicing

Will help debugging failing tests such as #184
This commit is contained in:
Guillaume Desmottes 2022-02-22 17:29:02 +01:00
parent 72d9d3dc58
commit 52f5dc0185

View file

@ -294,7 +294,7 @@ impl Item {
| ItemState::Blocked { uridecodebin, .. } | ItemState::Blocked { uridecodebin, .. }
| ItemState::Streaming { uridecodebin, .. } | ItemState::Streaming { uridecodebin, .. }
| ItemState::Done { uridecodebin, .. } => uridecodebin.clone(), | ItemState::Done { uridecodebin, .. } => uridecodebin.clone(),
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -314,7 +314,7 @@ impl Item {
| ItemState::Done { | ItemState::Done {
concat_sink_pads, .. concat_sink_pads, ..
} => concat_sink_pads.clone(), } => concat_sink_pads.clone(),
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -328,7 +328,7 @@ impl Item {
*n_pads_pendings -= 1; *n_pads_pendings -= 1;
*n_pads_pendings *n_pads_pendings
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -339,7 +339,7 @@ impl Item {
ItemState::WaitingForPads { receiver, .. } => receiver.clone(), ItemState::WaitingForPads { receiver, .. } => receiver.clone(),
ItemState::WaitingForStreamsynchronizerEos { receiver, .. } => receiver.clone(), ItemState::WaitingForStreamsynchronizerEos { receiver, .. } => receiver.clone(),
// receiver is no longer supposed to be accessed once in the `Blocked` state // receiver is no longer supposed to be accessed once in the `Blocked` state
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -350,7 +350,7 @@ impl Item {
ItemState::WaitingForStreamsynchronizerEos { decodebin_pads, .. } => { ItemState::WaitingForStreamsynchronizerEos { decodebin_pads, .. } => {
decodebin_pads.push(pad); decodebin_pads.push(pad);
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -363,7 +363,7 @@ impl Item {
*waiting_eos -= 1; *waiting_eos -= 1;
*waiting_eos == 0 *waiting_eos == 0
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -384,7 +384,7 @@ impl Item {
} => { } => {
*stream_selected_msg = Some(msg); *stream_selected_msg = Some(msg);
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -397,7 +397,7 @@ impl Item {
*waiting_eos -= 1; *waiting_eos -= 1;
*waiting_eos == 0 *waiting_eos == 0
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -410,7 +410,7 @@ impl Item {
} => { } => {
concat_sink_pads.push((concat.clone(), sink_pad.clone())); concat_sink_pads.push((concat.clone(), sink_pad.clone()));
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -455,7 +455,7 @@ impl Item {
receiver, receiver,
}; };
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -478,7 +478,7 @@ impl Item {
receiver, receiver,
}; };
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -526,7 +526,7 @@ impl Item {
(topology, pending_pads, sender) (topology, pending_pads, sender)
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -550,7 +550,7 @@ impl Item {
stream_selected_msg: None, stream_selected_msg: None,
}; };
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -585,7 +585,7 @@ impl Item {
(messages, sender) (messages, sender)
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
@ -604,7 +604,7 @@ impl Item {
concat_sink_pads: concat_sink_pads.clone(), concat_sink_pads: concat_sink_pads.clone(),
}; };
} }
_ => unreachable!(), _ => panic!("invalid state: {:?}", inner.state),
} }
} }
} }