diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-02-17 16:26:41 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-02-18 02:43:07 +0100 |
commit | 66acb3996dcb1d22c7ddcc22a1d2d5d7281c2d9e (patch) | |
tree | c1124f00f0258e9daa9719c46473e8e8c7cd50f5 /lib | |
parent | ef958abdaed3ccbbf1d07238db4f281d805678d0 (diff) | |
download | rockbox-66acb3996dcb1d22c7ddcc22a1d2d5d7281c2d9e.tar.gz rockbox-66acb3996dcb1d22c7ddcc22a1d2d5d7281c2d9e.zip |
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>
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/rbcodec/codecs/wma.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/lib/rbcodec/codecs/wma.c b/lib/rbcodec/codecs/wma.c index f9501ffad3..36e4285916 100755 --- a/lib/rbcodec/codecs/wma.c +++ b/lib/rbcodec/codecs/wma.c | |||
@@ -106,11 +106,7 @@ restart_track: | |||
106 | { | 106 | { |
107 | enum codec_command_action action = ci->get_command(¶m); | 107 | enum codec_command_action action = ci->get_command(¶m); |
108 | 108 | ||
109 | if (action == CODEC_ACTION_HALT) | 109 | if (action != CODEC_ACTION_NULL) { |
110 | break; | ||
111 | |||
112 | /* Deal with any pending seek requests */ | ||
113 | if (action == CODEC_ACTION_SEEK_TIME) { | ||
114 | 110 | ||
115 | /*flush the wma decoder state*/ | 111 | /*flush the wma decoder state*/ |
116 | wmadec.last_superframe_len = 0; | 112 | wmadec.last_superframe_len = 0; |
@@ -121,23 +117,31 @@ restart_track: | |||
121 | memset((*(wmadec.frame_out)), 0, | 117 | memset((*(wmadec.frame_out)), 0, |
122 | sizeof(fixed32) * MAX_CHANNELS * BLOCK_MAX_SIZE * 2); | 118 | sizeof(fixed32) * MAX_CHANNELS * BLOCK_MAX_SIZE * 2); |
123 | 119 | ||
124 | if (param == 0) { | 120 | if (action == CODEC_ACTION_HALT) |
125 | ci->set_elapsed(0); | 121 | break; |
126 | ci->seek_complete(); | 122 | |
127 | goto restart_track; /* Pretend you never saw this... */ | 123 | /* Deal with any pending seek requests */ |
128 | } | 124 | if (action == CODEC_ACTION_SEEK_TIME) { |
125 | |||
126 | if (param == 0) { | ||
127 | ci->set_elapsed(0); | ||
128 | ci->seek_complete(); | ||
129 | goto restart_track; /* Pretend you never saw this... */ | ||
130 | } | ||
131 | |||
132 | elapsedtime = asf_seek(param, &wfx); | ||
133 | if (elapsedtime < 1){ | ||
134 | ci->set_elapsed(0); | ||
135 | ci->seek_complete(); | ||
136 | break; | ||
137 | } | ||
138 | /*DEBUGF("Seek returned %d\n", (int)elapsedtime);*/ | ||
129 | 139 | ||
130 | elapsedtime = asf_seek(param, &wfx); | 140 | ci->set_elapsed(elapsedtime); |
131 | if (elapsedtime < 1){ | ||
132 | ci->set_elapsed(0); | ||
133 | ci->seek_complete(); | 141 | ci->seek_complete(); |
134 | break; | ||
135 | } | 142 | } |
136 | /*DEBUGF("Seek returned %d\n", (int)elapsedtime);*/ | ||
137 | |||
138 | ci->set_elapsed(elapsedtime); | ||
139 | ci->seek_complete(); | ||
140 | } | 143 | } |
144 | |||
141 | errcount = 0; | 145 | errcount = 0; |
142 | new_packet: | 146 | new_packet: |
143 | res = asf_read_packet(&audiobuf, &audiobufsize, &packetlength, &wfx); | 147 | res = asf_read_packet(&audiobuf, &audiobufsize, &packetlength, &wfx); |