audioencoder: Fix handling of offset/offset-end for Ogg codecs
Fixes the vorbisenc unit test.
This commit is contained in:
parent
345dc31f20
commit
b701534204
@ -726,8 +726,16 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
|
|||||||
GST_BUFFER_FLAG_SET (tmpbuf, GST_BUFFER_FLAG_DISCONT);
|
GST_BUFFER_FLAG_SET (tmpbuf, GST_BUFFER_FLAG_DISCONT);
|
||||||
priv->discont = FALSE;
|
priv->discont = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ogg codecs like Vorbis use offset/offset-end in a special
|
||||||
|
* way and both should be 0 for these codecs */
|
||||||
|
if (priv->base_gp >= 0) {
|
||||||
|
GST_BUFFER_OFFSET (tmpbuf) = 0;
|
||||||
|
GST_BUFFER_OFFSET_END (tmpbuf) = 0;
|
||||||
|
} else {
|
||||||
GST_BUFFER_OFFSET (tmpbuf) = priv->bytes_out;
|
GST_BUFFER_OFFSET (tmpbuf) = priv->bytes_out;
|
||||||
GST_BUFFER_OFFSET_END (tmpbuf) = priv->bytes_out + size;
|
GST_BUFFER_OFFSET_END (tmpbuf) = priv->bytes_out + size;
|
||||||
|
}
|
||||||
|
|
||||||
priv->bytes_out += size;
|
priv->bytes_out += size;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user