diff options
Diffstat (limited to 'lib/rbcodec/codecs/wma.c')
-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); |