summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-08-29 16:43:11 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-08-29 16:43:11 +0000
commitd4567b64bae0df28d2ab667c7f8b3cd2d9432227 (patch)
treea0f73f4a368e75ef39f490f4aea4903d3ed50964
parent7c8a49dbff219624b764f392e33170befd38f3ab (diff)
downloadrockbox-d4567b64bae0df28d2ab667c7f8b3cd2d9432227.tar.gz
rockbox-d4567b64bae0df28d2ab667c7f8b3cd2d9432227.zip
Clean up alac/acc demux structure on next track. Solves issues with some files only being playable on direct selection, but not if switched to via playback engine or skip.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27939 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/aac.c18
-rw-r--r--apps/codecs/alac.c2
2 files changed, 12 insertions, 8 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index 1796133e53..55254f41d8 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -69,8 +69,10 @@ enum codec_status codec_main(void)
69next_track: 69next_track:
70 err = CODEC_OK; 70 err = CODEC_OK;
71 71
72 /* Clean and initialize decoder structures */
73 memset(&demux_res , 0, sizeof(demux_res));
72 if (codec_init()) { 74 if (codec_init()) {
73 LOGF("FAAD: Codec init error\n"); 75 printf("FAAD: Codec init error\n");
74 err = CODEC_ERROR; 76 err = CODEC_ERROR;
75 goto exit; 77 goto exit;
76 } 78 }
@@ -88,7 +90,7 @@ next_track:
88 /* if qtmovie_read returns successfully, the stream is up to 90 /* if qtmovie_read returns successfully, the stream is up to
89 * the movie data, which can be used directly by the decoder */ 91 * the movie data, which can be used directly by the decoder */
90 if (!qtmovie_read(&input_stream, &demux_res)) { 92 if (!qtmovie_read(&input_stream, &demux_res)) {
91 LOGF("FAAD: File init error\n"); 93 printf("FAAD: File init error\n");
92 err = CODEC_ERROR; 94 err = CODEC_ERROR;
93 goto done; 95 goto done;
94 } 96 }
@@ -97,7 +99,7 @@ next_track:
97 decoder = NeAACDecOpen(); 99 decoder = NeAACDecOpen();
98 100
99 if (!decoder) { 101 if (!decoder) {
100 LOGF("FAAD: Decode open error\n"); 102 printf("FAAD: Decode open error\n");
101 err = CODEC_ERROR; 103 err = CODEC_ERROR;
102 goto done; 104 goto done;
103 } 105 }
@@ -108,7 +110,7 @@ next_track:
108 110
109 err = NeAACDecInit2(decoder, demux_res.codecdata, demux_res.codecdata_len, &s, &c); 111 err = NeAACDecInit2(decoder, demux_res.codecdata, demux_res.codecdata_len, &s, &c);
110 if (err) { 112 if (err) {
111 LOGF("FAAD: DecInit: %d, %d\n", err, decoder->object_type); 113 printf("FAAD: DecInit: %d, %d\n", err, decoder->object_type);
112 err = CODEC_ERROR; 114 err = CODEC_ERROR;
113 goto done; 115 goto done;
114 } 116 }
@@ -189,7 +191,7 @@ next_track:
189 /* Lookup the length (in samples and bytes) of block i */ 191 /* Lookup the length (in samples and bytes) of block i */
190 if (!get_sample_info(&demux_res, i, &sample_duration, 192 if (!get_sample_info(&demux_res, i, &sample_duration,
191 &sample_byte_size)) { 193 &sample_byte_size)) {
192 LOGF("AAC: get_sample_info error\n"); 194 printf("AAC: get_sample_info error\n");
193 err = CODEC_ERROR; 195 err = CODEC_ERROR;
194 goto done; 196 goto done;
195 } 197 }
@@ -208,7 +210,7 @@ next_track:
208 } 210 }
209 else if (file_offset == 0) 211 else if (file_offset == 0)
210 { 212 {
211 LOGF("AAC: get_sample_offset error\n"); 213 printf("AAC: get_sample_offset error\n");
212 err = CODEC_ERROR; 214 err = CODEC_ERROR;
213 goto done; 215 goto done;
214 } 216 }
@@ -221,7 +223,7 @@ next_track:
221 223
222 /* NeAACDecDecode may sometimes return NULL without setting error. */ 224 /* NeAACDecDecode may sometimes return NULL without setting error. */
223 if (ret == NULL || frame_info.error > 0) { 225 if (ret == NULL || frame_info.error > 0) {
224 LOGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error)); 226 printf("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error));
225 err = CODEC_ERROR; 227 err = CODEC_ERROR;
226 goto done; 228 goto done;
227 } 229 }
@@ -282,7 +284,7 @@ next_track:
282 err = CODEC_OK; 284 err = CODEC_OK;
283 285
284done: 286done:
285 LOGF("AAC: Decoded %lu samples\n", (unsigned long)sound_samples_done); 287 printf("AAC: Decoded %lu samples\n", (unsigned long)sound_samples_done);
286 288
287 if (ci->request_next_track()) 289 if (ci->request_next_track())
288 goto next_track; 290 goto next_track;
diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c
index ebcc657ed7..003d222f00 100644
--- a/apps/codecs/alac.c
+++ b/apps/codecs/alac.c
@@ -49,6 +49,8 @@ enum codec_status codec_main(void)
49 49
50 next_track: 50 next_track:
51 51
52 /* Clean and initialize decoder structures */
53 memset(&demux_res , 0, sizeof(demux_res));
52 if (codec_init()) { 54 if (codec_init()) {
53 LOGF("ALAC: Error initialising codec\n"); 55 LOGF("ALAC: Error initialising codec\n");
54 retval = CODEC_ERROR; 56 retval = CODEC_ERROR;