remove unused "bytes_written" bookkeeping in FLAC__OggEncoderAspect
This commit is contained in:
parent
334defde11
commit
cf221fee1b
@ -46,15 +46,6 @@ typedef struct OggFLAC__OggEncoderAspect {
|
||||
ogg_page page;
|
||||
FLAC__bool is_first_packet;
|
||||
FLAC__uint64 samples_written;
|
||||
/*
|
||||
* This is sum total of 'bytes' that have come through the write
|
||||
* callback proxy since init time. It can be checked to get an
|
||||
* un-Ogg-buffered current file position.
|
||||
*/
|
||||
#if 0
|
||||
/*@@@@@@ not used, get rid of it? */
|
||||
FLAC__uint64 bytes_written;
|
||||
#endif
|
||||
} OggFLAC__OggEncoderAspect;
|
||||
|
||||
void OggFLAC__ogg_encoder_aspect_set_serial_number(OggFLAC__OggEncoderAspect *aspect, long value);
|
||||
|
@ -47,10 +47,6 @@ FLAC__bool OggFLAC__ogg_encoder_aspect_init(OggFLAC__OggEncoderAspect *aspect)
|
||||
|
||||
aspect->is_first_packet = true;
|
||||
aspect->samples_written = 0;
|
||||
#if 0
|
||||
/*@@@@@@ not used, get rid of it? */
|
||||
aspect->bytes_written = 0;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -104,39 +100,21 @@ FLAC__StreamEncoderWriteStatus OggFLAC__ogg_encoder_aspect_write_callback_wrappe
|
||||
*
|
||||
* For audio frames, we let Ogg do the paging.
|
||||
*/
|
||||
/*@@@@@@ combine fLaC header + STREAMINFO into the first page? 2 packets or 1 packet? */
|
||||
/*@@@@@@ need our own implementation of ogg_stream_flush to max out the page instead of use its 4096 nominal page size */
|
||||
/*@@@@@@ can't figure out a way to pass a useful number for 'samples' to the write_callback, so we'll just pass 0 */
|
||||
if (is_metadata) {
|
||||
while(ogg_stream_flush(&aspect->stream_state, &aspect->page) != 0) {
|
||||
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 0
|
||||
/*@@@@@@ not used, get rid of it? */
|
||||
aspect->bytes_written += aspect->page.header_len;
|
||||
#endif
|
||||
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;
|
||||
#if 0
|
||||
/*@@@@@@ not used, get rid of it? */
|
||||
aspect->bytes_written += aspect->page.body_len;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
while(ogg_stream_pageout(&aspect->stream_state, &aspect->page) != 0) {
|
||||
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 0
|
||||
/*@@@@@@ not used, get rid of it? */
|
||||
aspect->bytes_written += aspect->page.header_len;
|
||||
#endif
|
||||
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;
|
||||
#if 0
|
||||
/*@@@@@@ not used, get rid of it? */
|
||||
aspect->bytes_written += aspect->page.body_len;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user