diff options
author | waker <wakeroid@gmail.com> | 2013-07-06 16:46:43 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2013-07-06 16:46:43 +0200 |
commit | 362c82591f489696d804bad3cab37e5a3184d4da (patch) | |
tree | 031d39700ab545d0fc90af03e8bb612fffa7ef50 /plugins/wma/libasf | |
parent | fc455eb3842de79f638a3982eb30e1728ac1f736 (diff) |
mms radio now works using the new wma plugin
Diffstat (limited to 'plugins/wma/libasf')
-rw-r--r-- | plugins/wma/libasf/asf.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/wma/libasf/asf.c b/plugins/wma/libasf/asf.c index 595a27ac..1e4c734c 100644 --- a/plugins/wma/libasf/asf.c +++ b/plugins/wma/libasf/asf.c @@ -33,6 +33,13 @@ extern DB_functions_t *deadbeef; #define trace(fmt,...) #define DEBUGF trace +#define SKIP_BYTES(fd,x) {\ + if (x > 0) {\ + char buf[x];\ + deadbeef->fread (buf, x, 1, fd);\ + }\ +} + /* Read an unaligned 32-bit little endian long from buffer. */ static unsigned long get_long_le(void* buf) { @@ -108,7 +115,7 @@ int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength, } /* Skip ec_data */ - deadbeef->fseek(fp, ec_length, SEEK_CUR); + SKIP_BYTES(fp, ec_length); bytesread += ec_length; } else { ec_length = 0; @@ -355,7 +362,7 @@ int asf_get_timestamp(int *duration, DB_FILE *fp) } /* Skip ec_data */ - deadbeef->fseek (fp, ec_length, SEEK_CUR); + SKIP_BYTES(fp, ec_length); bytesread += ec_length; } else { ec_length = 0; @@ -398,7 +405,7 @@ int asf_get_timestamp(int *duration, DB_FILE *fp) /*the asf_get_timestamp function advances us 12-13 bytes past the packet start, need to undo this here so that we stay synced with the packet*/ - deadbeef->fseek(fp, -bytesread, SEEK_CUR); + deadbeef->fseek (fp, -bytesread, SEEK_CUR); return send_time; } |