schroenc: set right OFFSET and OFFSET_END on header buffers to make oggmux happy

Without this oggmux will just keep buffering output pages in some cases.

Fixes #593024.
This commit is contained in:
Arek Korbik 2009-08-26 00:26:42 +01:00 committed by Tim-Philipp Müller
parent 09b2abf87b
commit f1c4bdf5be

View file

@ -526,6 +526,13 @@ gst_schro_enc_get_caps (GstBaseVideoEncoder * base_video_encoder)
g_value_init (&value, GST_TYPE_BUFFER); g_value_init (&value, GST_TYPE_BUFFER);
size = GST_BUFFER_SIZE (schro_enc->seq_header_buffer); size = GST_BUFFER_SIZE (schro_enc->seq_header_buffer);
buf = gst_buffer_new_and_alloc (size + SCHRO_PARSE_HEADER_SIZE); buf = gst_buffer_new_and_alloc (size + SCHRO_PARSE_HEADER_SIZE);
/* ogg(mux) expects the header buffers to have 0 timestamps -
set OFFSET and OFFSET_END accordingly */
GST_BUFFER_OFFSET (buf) = 0;
GST_BUFFER_OFFSET_END (buf) = 0;
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
memcpy (GST_BUFFER_DATA (buf), memcpy (GST_BUFFER_DATA (buf),
GST_BUFFER_DATA (schro_enc->seq_header_buffer), size); GST_BUFFER_DATA (schro_enc->seq_header_buffer), size);
GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf) + size + 0, 0x42424344); GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf) + size + 0, 0x42424344);