examples/transcode-audio: do not panic in case of decoding error

This commit is contained in:
meh 2015-09-12 20:42:24 +02:00
parent a7fcbd81fa
commit b50a3673a1

View File

@ -107,7 +107,7 @@ fn main() {
if stream.index() == transcoder.stream { if stream.index() == transcoder.stream {
packet.rescale_ts(stream.time_base(), in_time_base); packet.rescale_ts(stream.time_base(), in_time_base);
if transcoder.decoder.decode(&packet, &mut decoded).unwrap() { if let Ok(true) = transcoder.decoder.decode(&packet, &mut decoded) {
let timestamp = decoded.timestamp(); let timestamp = decoded.timestamp();
decoded.set_pts(timestamp); decoded.set_pts(timestamp);