opusenc: the encoder might not make use of all the bytes

This commit is contained in:
Vincent Penquerc'h 2011-11-16 19:22:44 +00:00
parent b7cb6ecedb
commit f8bb784135

View file

@ -588,7 +588,7 @@ gst_opus_enc_encode (GstOpusEnc * enc, GstBuffer * buf)
GST_ERROR_OBJECT (enc, "Encoding failed: %d", outsize);
ret = GST_FLOW_ERROR;
goto done;
} else if (outsize != bytes_per_packet) {
} else if (outsize > bytes_per_packet) {
GST_WARNING_OBJECT (enc,
"Encoded size %d is different from %d bytes per packet", outsize,
bytes_per_packet);
@ -596,6 +596,8 @@ gst_opus_enc_encode (GstOpusEnc * enc, GstBuffer * buf)
goto done;
}
GST_BUFFER_SIZE (outbuf) = outsize;
ret =
gst_audio_encoder_finish_frame (GST_AUDIO_ENCODER (enc), outbuf,
enc->frame_samples);