Commit 0ee33237 authored by Philippe Normand's avatar Philippe Normand Committed by Sebastian Dröge

wavenc: generate a non-empty data header

Restore the behavior of the element to the state before commit
db29522a. A non-empty header is
generated and when the EOS event is received the header is generated
again, this time with the correct size.

https://bugzilla.gnome.org/show_bug.cgi?id=711699
parent c8db05d6
......@@ -854,8 +854,7 @@ gst_wavenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
/* starting a file, means we have to finish it properly */
wavenc->finished_properly = FALSE;
/* use bogus size initially, we'll write the real
* header when we get EOS and know the exact length */
/* push initial bogus header, it will be updated on EOS */
flow = gst_wavenc_push_header (wavenc);
if (flow != GST_FLOW_OK) {
GST_WARNING_OBJECT (wavenc, "error pushing header: %s",
......@@ -863,6 +862,7 @@ gst_wavenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
return flow;
}
GST_DEBUG_OBJECT (wavenc, "wrote dummy header");
wavenc->audio_length = 0;
wavenc->sent_header = TRUE;
}
......@@ -894,7 +894,9 @@ gst_wavenc_change_state (GstElement * element, GstStateChange transition)
wavenc->channels = 0;
wavenc->width = 0;
wavenc->rate = 0;
wavenc->audio_length = 0;
/* use bogus size initially, we'll write the real
* header when we get EOS and know the exact length */
wavenc->audio_length = 0x7FFF0000;
wavenc->meta_length = 0;
wavenc->sent_header = FALSE;
/* its true because we haven't writen anything */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment