summaryrefslogtreecommitdiff
path: root/apps/metadata
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-06-21 10:48:34 +0000
committerMohamed Tarek <mt@rockbox.org>2010-06-21 10:48:34 +0000
commit816fca820caa537a07c761f49d1f8ecf996a91ce (patch)
tree8ea2805d0536bd45c7a4f56fa39904e65829466a /apps/metadata
parent9297a02d4964cae7727248665e278b251cac5533 (diff)
downloadrockbox-816fca820caa537a07c761f49d1f8ecf996a91ce.zip
rockbox-816fca820caa537a07c761f49d1f8ecf996a91ce.tar.gz
rockbox-816fca820caa537a07c761f49d1f8ecf996a91ce.tar.bz2
rockbox-816fca820caa537a07c761f49d1f8ecf996a91ce.tar.xz
Wrote apps/codecs/wmapro.c and modified libwmapro to make the codec work in the sim. Neither libwmapro nor wmapro.c have been added to the main build yet, codecs.make should be edited to compile both with rockbox.
current status of the decoder : - Plays and seeks in the sim - Still in floating point git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27006 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata')
-rw-r--r--apps/metadata/asf.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/metadata/asf.c b/apps/metadata/asf.c
index db806ea..ba1b897 100644
--- a/apps/metadata/asf.c
+++ b/apps/metadata/asf.c
@@ -274,9 +274,14 @@ static int asf_parse_header(int fd, struct mp3entry* id3,
}
fileprop = 1;
- /* All we want is the play duration - uint64_t at offset 40 */
- lseek(fd, 40, SEEK_CUR);
-
+
+ /* Get the number of logical packets - uint16_t at offset 31
+ * (Big endian byte order) */
+ lseek(fd, 31, SEEK_CUR);
+ read_uint16be(fd, &wfx->numpackets);
+
+ /* Now get the play duration - uint64_t at offset 40 */
+ lseek(fd, 7, SEEK_CUR);
read_uint64le(fd, &play_duration);
id3->length = play_duration / 10000;
@@ -346,8 +351,9 @@ static int asf_parse_header(int fd, struct mp3entry* id3,
lseek(fd,current.size - 24 - 72 - 6,SEEK_CUR);
wfx->audiostream = flags&0x7f;
} else if (wfx->codec_id == ASF_CODEC_ID_WMAPRO) {
- read(fd, wfx->data, 10);
- lseek(fd,current.size - 24 - 72 - 10,SEEK_CUR);
+ /* wma pro decoder needs the extra-data */
+ read(fd, wfx->data, wfx->datalen);
+ lseek(fd,current.size - 24 - 72 - wfx->datalen,SEEK_CUR);
wfx->audiostream = flags&0x7f;
/* Correct codectype to redirect playback to the proper .codec */
id3->codectype = AFMT_WMAPRO;