output/recorder, test/*: invoke encoder_read() after _open()
Make sure the file header gets written at the beginning, before _write() gets called.
This commit is contained in:
@@ -106,6 +106,8 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
encoder_to_stdout(encoder);
|
||||
|
||||
/* do it */
|
||||
|
||||
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
|
||||
|
@@ -67,6 +67,8 @@ main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv)
|
||||
success = encoder_open(encoder, &audio_format, NULL);
|
||||
assert(success);
|
||||
|
||||
encoder_to_stdout(encoder);
|
||||
|
||||
/* write a block of data */
|
||||
|
||||
success = encoder_write(encoder, zero, sizeof(zero), NULL);
|
||||
|
Reference in New Issue
Block a user