B15: ec-pcm-ext send_packet while a frame is pending returns NeedMore instead of dropping it
Browse files at this commita7e1cd197be7be4e1499d0e4988e77fdf585d697Parent: 22f0f3f1 changed file +3 -0
crates/ec-pcm-ext/src/lib.rsmodified+3 -0
| @@ -344,6 +344,9 @@ impl Decoder for PcmExtDecoder { | ||
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | fn send_packet(&mut self, packet: &Packet) -> Result<()> { |
| 347 | + if self.pending.is_some() { | |
| 348 | + return Err(Error::NeedMore); | |
| 349 | + } | |
| 347 | 350 | self.decode(&packet.data)?; |
| 348 | 351 | let channels = self.channels; |
| 349 | 352 | let mut bytes = Vec::with_capacity(self.out.len() * 2); |