Created
December 1, 2010 05:18
-
-
Save oneman/722998 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aspect->samples_since_last_flush += samples; | |
| printf("Samples at the moment: %d\n", samples); | |
| printf("Samples since last flush: %d\n", aspect->samples_since_last_flush); | |
| if (aspect->samples_since_last_flush >= (4096 * 4)) { | |
| printf("Flushing since we got %d samples\n", aspect->samples_since_last_flush); | |
| while(ogg_stream_flush(&aspect->stream_state, &aspect->page) != 0) { | |
| printf("did a flush - "); | |
| if(write_callback(encoder, aspect->page.header, aspect->page.header_len, 0, current_frame, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) | |
| return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; | |
| if(write_callback(encoder, aspect->page.body, aspect->page.body_len, 0, current_frame, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) | |
| return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; | |
| } | |
| printf("done flushing part\n"); | |
| aspect->samples_since_last_flush = 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment