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 | fn send_packet(&mut self, packet: &Packet) -> Result<()> { | 346 | fn send_packet(&mut self, packet: &Packet) -> Result<()> { |
| 347 | + if self.pending.is_some() { | ||
| 348 | + return Err(Error::NeedMore); | ||
| 349 | + } | ||
| 347 | self.decode(&packet.data)?; | 350 | self.decode(&packet.data)?; |
| 348 | let channels = self.channels; | 351 | let channels = self.channels; |
| 349 | let mut bytes = Vec::with_capacity(self.out.len() * 2); | 352 | let mut bytes = Vec::with_capacity(self.out.len() * 2); |