mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Fix FSB#12826 - Mini-sound burp between track skips [with WMA].
Flush decoder state and frame out buffer upon a forced stop to prevent a short burst of stale audio from the previously decoding track from playing when skipping from one WMA track to another. Change-Id: I24c910c5dbd83caed2510db68d9e39a474332a79 Reviewed-on: http://gerrit.rockbox.org/406 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
This commit is contained in:
parent
ef958abdae
commit
66acb3996d
1 changed files with 23 additions and 19 deletions
|
@ -106,11 +106,7 @@ restart_track:
|
||||||
{
|
{
|
||||||
enum codec_command_action action = ci->get_command(¶m);
|
enum codec_command_action action = ci->get_command(¶m);
|
||||||
|
|
||||||
if (action == CODEC_ACTION_HALT)
|
if (action != CODEC_ACTION_NULL) {
|
||||||
break;
|
|
||||||
|
|
||||||
/* Deal with any pending seek requests */
|
|
||||||
if (action == CODEC_ACTION_SEEK_TIME) {
|
|
||||||
|
|
||||||
/*flush the wma decoder state*/
|
/*flush the wma decoder state*/
|
||||||
wmadec.last_superframe_len = 0;
|
wmadec.last_superframe_len = 0;
|
||||||
|
@ -121,23 +117,31 @@ restart_track:
|
||||||
memset((*(wmadec.frame_out)), 0,
|
memset((*(wmadec.frame_out)), 0,
|
||||||
sizeof(fixed32) * MAX_CHANNELS * BLOCK_MAX_SIZE * 2);
|
sizeof(fixed32) * MAX_CHANNELS * BLOCK_MAX_SIZE * 2);
|
||||||
|
|
||||||
if (param == 0) {
|
if (action == CODEC_ACTION_HALT)
|
||||||
ci->set_elapsed(0);
|
|
||||||
ci->seek_complete();
|
|
||||||
goto restart_track; /* Pretend you never saw this... */
|
|
||||||
}
|
|
||||||
|
|
||||||
elapsedtime = asf_seek(param, &wfx);
|
|
||||||
if (elapsedtime < 1){
|
|
||||||
ci->set_elapsed(0);
|
|
||||||
ci->seek_complete();
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
/*DEBUGF("Seek returned %d\n", (int)elapsedtime);*/
|
|
||||||
|
|
||||||
ci->set_elapsed(elapsedtime);
|
/* Deal with any pending seek requests */
|
||||||
ci->seek_complete();
|
if (action == CODEC_ACTION_SEEK_TIME) {
|
||||||
|
|
||||||
|
if (param == 0) {
|
||||||
|
ci->set_elapsed(0);
|
||||||
|
ci->seek_complete();
|
||||||
|
goto restart_track; /* Pretend you never saw this... */
|
||||||
|
}
|
||||||
|
|
||||||
|
elapsedtime = asf_seek(param, &wfx);
|
||||||
|
if (elapsedtime < 1){
|
||||||
|
ci->set_elapsed(0);
|
||||||
|
ci->seek_complete();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/*DEBUGF("Seek returned %d\n", (int)elapsedtime);*/
|
||||||
|
|
||||||
|
ci->set_elapsed(elapsedtime);
|
||||||
|
ci->seek_complete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
errcount = 0;
|
errcount = 0;
|
||||||
new_packet:
|
new_packet:
|
||||||
res = asf_read_packet(&audiobuf, &audiobufsize, &packetlength, &wfx);
|
res = asf_read_packet(&audiobuf, &audiobufsize, &packetlength, &wfx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue