summaryrefslogtreecommitdiffstats
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)
next_track:
err = CODEC_OK;
+ /* Clean and initialize decoder structures */
+ memset(&demux_res , 0, sizeof(demux_res));
if (codec_init()) {
- LOGF("FAAD: Codec init error\n");
+ printf("FAAD: Codec init error\n");
err = CODEC_ERROR;
goto exit;
}
@@ -88,7 +90,7 @@ next_track:
/* if qtmovie_read returns successfully, the stream is up to
* the movie data, which can be used directly by the decoder */
if (!qtmovie_read(&input_stream, &demux_res)) {
- LOGF("FAAD: File init error\n");
+ printf("FAAD: File init error\n");
err = CODEC_ERROR;
goto done;
}
@@ -97,7 +99,7 @@ next_track:
decoder = NeAACDecOpen();
if (!decoder) {
- LOGF("FAAD: Decode open error\n");
+ printf("FAAD: Decode open error\n");
err = CODEC_ERROR;
goto done;
}
@@ -108,7 +110,7 @@ next_track:
err = NeAACDecInit2(decoder, demux_res.codecdata, demux_res.codecdata_len, &s, &c);
if (err) {
- LOGF("FAAD: DecInit: %d, %d\n", err, decoder->object_type);
+ printf("FAAD: DecInit: %d, %d\n", err, decoder->object_type);
err = CODEC_ERROR;
goto done;
}
@@ -189,7 +191,7 @@ next_track:
/* Lookup the length (in samples and bytes) of block i */
if (!get_sample_info(&demux_res, i, &sample_duration,
&sample_byte_size)) {
- LOGF("AAC: get_sample_info error\n");
+ printf("AAC: get_sample_info error\n");
err = CODEC_ERROR;
goto done;
}
@@ -208,7 +210,7 @@ next_track:
}
else if (file_offset == 0)
{
- LOGF("AAC: get_sample_offset error\n");
+ printf("AAC: get_sample_offset error\n");
err = CODEC_ERROR;
goto done;
}
@@ -221,7 +223,7 @@ next_track:
/* NeAACDecDecode may sometimes return NULL without setting error. */
if (ret == NULL || frame_info.error > 0) {
- LOGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error));
+ printf("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error));
err = CODEC_ERROR;
goto done;
}
@@ -282,7 +284,7 @@ next_track:
err = CODEC_OK;
done:
- LOGF("AAC: Decoded %lu samples\n", (unsigned long)sound_samples_done);
+ printf("AAC: Decoded %lu samples\n", (unsigned long)sound_samples_done);
if (ci->request_next_track())
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)
next_track:
+ /* Clean and initialize decoder structures */
+ memset(&demux_res , 0, sizeof(demux_res));
if (codec_init()) {
LOGF("ALAC: Error initialising codec\n");
retval = CODEC_ERROR;