wavenc: generate a non-empty data header
Restore the behavior of the element to the state before commit db29522a430e44450415ca3676abd1b77ee923d9. 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
This commit is contained in:
parent
c8db05d610
commit
0ee332378b
@ -854,8 +854,7 @@ gst_wavenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||||||
/* starting a file, means we have to finish it properly */
|
/* starting a file, means we have to finish it properly */
|
||||||
wavenc->finished_properly = FALSE;
|
wavenc->finished_properly = FALSE;
|
||||||
|
|
||||||
/* use bogus size initially, we'll write the real
|
/* push initial bogus header, it will be updated on EOS */
|
||||||
* header when we get EOS and know the exact length */
|
|
||||||
flow = gst_wavenc_push_header (wavenc);
|
flow = gst_wavenc_push_header (wavenc);
|
||||||
if (flow != GST_FLOW_OK) {
|
if (flow != GST_FLOW_OK) {
|
||||||
GST_WARNING_OBJECT (wavenc, "error pushing header: %s",
|
GST_WARNING_OBJECT (wavenc, "error pushing header: %s",
|
||||||
@ -863,6 +862,7 @@ gst_wavenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||||||
return flow;
|
return flow;
|
||||||
}
|
}
|
||||||
GST_DEBUG_OBJECT (wavenc, "wrote dummy header");
|
GST_DEBUG_OBJECT (wavenc, "wrote dummy header");
|
||||||
|
wavenc->audio_length = 0;
|
||||||
wavenc->sent_header = TRUE;
|
wavenc->sent_header = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -894,7 +894,9 @@ gst_wavenc_change_state (GstElement * element, GstStateChange transition)
|
|||||||
wavenc->channels = 0;
|
wavenc->channels = 0;
|
||||||
wavenc->width = 0;
|
wavenc->width = 0;
|
||||||
wavenc->rate = 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->meta_length = 0;
|
||||||
wavenc->sent_header = FALSE;
|
wavenc->sent_header = FALSE;
|
||||||
/* its true because we haven't writen anything */
|
/* its true because we haven't writen anything */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user