forked from len0rd/rockbox
Clean up comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27078 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f101c8ad62
commit
fc1fab4776
1 changed files with 16 additions and 16 deletions
|
|
@ -35,9 +35,7 @@ static mpc_int32_t read_impl(mpc_reader *reader, void *ptr, mpc_int32_t size)
|
|||
}
|
||||
|
||||
static mpc_bool_t seek_impl(mpc_reader *reader, mpc_int32_t offset)
|
||||
{
|
||||
/* WARNING: assumes we don't need to skip too far into the past,
|
||||
this might not be supported by the buffering layer yet */
|
||||
{
|
||||
(void)reader;
|
||||
return ci->seek_buffer(offset);
|
||||
}
|
||||
|
|
@ -54,7 +52,7 @@ static mpc_int32_t get_size_impl(mpc_reader *reader)
|
|||
return ci->filesize;
|
||||
}
|
||||
|
||||
/* this is the codec entry point */
|
||||
/* This is the codec entry point. */
|
||||
enum codec_status codec_main(void)
|
||||
{
|
||||
mpc_int64_t samplesdone;
|
||||
|
|
@ -90,14 +88,14 @@ next_track:
|
|||
while (!*ci->taginfo_ready && !ci->stop_codec)
|
||||
ci->sleep(1);
|
||||
|
||||
/* initialize demux/decoder */
|
||||
/* Initialize demux/decoder. */
|
||||
demux = mpc_demux_init(&reader);
|
||||
if (NULL == demux)
|
||||
{
|
||||
retval = CODEC_ERROR;
|
||||
goto done;
|
||||
}
|
||||
/* read file's streaminfo data */
|
||||
/* Read file's streaminfo data. */
|
||||
mpc_demux_get_info(demux, &info);
|
||||
|
||||
byterate = (mpc_uint32_t)(info.average_bitrate) / 8;
|
||||
|
|
@ -110,7 +108,7 @@ next_track:
|
|||
* there is no loss of information except rounding. */
|
||||
samplesdone = 100 * ((mpc_uint64_t)(ci->id3->offset * frequency) / byterate);
|
||||
|
||||
/* set playback engine up for correct number of channels */
|
||||
/* Set up digital signal processing for correct number of channels */
|
||||
/* NOTE: current musepack format only allows for stereo files
|
||||
but code is here to handle other configurations anyway */
|
||||
if (info.channels == 2)
|
||||
|
|
@ -126,8 +124,8 @@ next_track:
|
|||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Resume to saved sample offset. */
|
||||
if (samplesdone > 0) {
|
||||
/* hack to improve seek time if filebuf goes empty */
|
||||
if (samplesdone > 0)
|
||||
{
|
||||
if (mpc_demux_seek_sample(demux, samplesdone) == MPC_STATUS_OK)
|
||||
{
|
||||
elapsed_time = (samplesdone*10)/frequency;
|
||||
|
|
@ -137,15 +135,14 @@ next_track:
|
|||
{
|
||||
samplesdone = 0;
|
||||
}
|
||||
/* reset chunksize */
|
||||
}
|
||||
|
||||
/* This is the decoding loop. */
|
||||
do {
|
||||
/* Complete seek handler. */
|
||||
do
|
||||
{
|
||||
/* Complete seek handler. */
|
||||
if (ci->seek_time)
|
||||
{
|
||||
/* hack to improve seek time if filebuf goes empty */
|
||||
mpc_int64_t new_offset = ((ci->seek_time - 1)/10)*frequency;
|
||||
if (mpc_demux_seek_sample(demux, new_offset) == MPC_STATUS_OK)
|
||||
{
|
||||
|
|
@ -153,20 +150,24 @@ next_track:
|
|||
ci->set_elapsed(ci->seek_time);
|
||||
}
|
||||
ci->seek_complete();
|
||||
/* reset chunksize */
|
||||
}
|
||||
|
||||
/* Stop or skip occured, exit decoding loop. */
|
||||
if (ci->stop_codec || ci->new_track)
|
||||
break;
|
||||
|
||||
/* Decode one frame. */
|
||||
status = mpc_demux_decode(demux, &frame);
|
||||
ci->yield();
|
||||
if (frame.bits == -1) /* decoding stopped */
|
||||
if (frame.bits == -1)
|
||||
{
|
||||
/* Decoding error, exit decoding loop. */
|
||||
retval = (status == MPC_STATUS_OK) ? CODEC_OK : CODEC_ERROR;
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Decoding passed, insert samples to PCM buffer. */
|
||||
ci->pcmbuf_insert(frame.buffer,
|
||||
frame.buffer + MPC_FRAME_LENGTH,
|
||||
frame.samples);
|
||||
|
|
@ -186,4 +187,3 @@ done:
|
|||
exit:
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue