Merge branch 'v0.19.x'
This commit is contained in:
commit
557bee61d5
3
NEWS
3
NEWS
@ -29,6 +29,9 @@ ver 0.20 (not yet released)
|
||||
- proxy: add TCP keepalive option
|
||||
|
||||
ver 0.19.9 (not yet released)
|
||||
* decoder
|
||||
- dsdiff, dsf: raise ID3 tag limit to 1 MB
|
||||
* fix clock integer overflow on OS X
|
||||
* fix build failure with uClibc
|
||||
* fix build failure on non-POSIX operating systems
|
||||
|
||||
|
@ -334,7 +334,7 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info)
|
||||
directory_set_stat(directory, info);
|
||||
|
||||
Error error;
|
||||
const std::auto_ptr<StorageDirectoryReader> reader(storage.OpenDirectory(directory.GetPath(), error));
|
||||
const std::unique_ptr<StorageDirectoryReader> reader(storage.OpenDirectory(directory.GetPath(), error));
|
||||
if (reader.get() == nullptr) {
|
||||
LogError(error);
|
||||
return false;
|
||||
|
@ -125,27 +125,26 @@ dsdlib_tag_id3(InputStream &is,
|
||||
|
||||
const id3_length_t count = size - offset;
|
||||
|
||||
if (count < 10 || count > 256*1024)
|
||||
if (count < 10 || count > 1024 * 1024)
|
||||
return;
|
||||
|
||||
id3_byte_t *const id3_buf = static_cast<id3_byte_t*>(xalloc(count));
|
||||
id3_byte_t *const id3_buf = new id3_byte_t[count];
|
||||
if (id3_buf == nullptr)
|
||||
return;
|
||||
|
||||
if (!decoder_read_full(nullptr, is, id3_buf, count)) {
|
||||
free(id3_buf);
|
||||
delete[] id3_buf;
|
||||
return;
|
||||
}
|
||||
|
||||
struct id3_tag *id3_tag = id3_tag_parse(id3_buf, count);
|
||||
if (id3_tag == nullptr) {
|
||||
free(id3_buf);
|
||||
delete[] id3_buf;
|
||||
if (id3_tag == nullptr)
|
||||
return;
|
||||
}
|
||||
|
||||
scan_id3_tag(id3_tag, handler, handler_ctx);
|
||||
|
||||
id3_tag_delete(id3_tag);
|
||||
|
||||
free(id3_buf);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -40,8 +40,8 @@ MonotonicClockS(void)
|
||||
if (base.denom == 0)
|
||||
(void)mach_timebase_info(&base);
|
||||
|
||||
return (unsigned)((mach_absolute_time() * base.numer / 1000)
|
||||
/ (1000000 * base.denom));
|
||||
return (unsigned)(((double)mach_absolute_time() * base.numer / 1000)
|
||||
/ base.denom / 1000000);
|
||||
#elif defined(CLOCK_MONOTONIC)
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
@ -62,8 +62,8 @@ MonotonicClockMS(void)
|
||||
if (base.denom == 0)
|
||||
(void)mach_timebase_info(&base);
|
||||
|
||||
return (unsigned)((mach_absolute_time() * base.numer)
|
||||
/ (1000000 * base.denom));
|
||||
return (unsigned)(((double)mach_absolute_time() * base.numer)
|
||||
/ base.denom / 1000000);
|
||||
#elif defined(CLOCK_MONOTONIC)
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
@ -104,8 +104,8 @@ MonotonicClockUS(void)
|
||||
if (base.denom == 0)
|
||||
(void)mach_timebase_info(&base);
|
||||
|
||||
return ((uint64_t)mach_absolute_time() * (uint64_t)base.numer)
|
||||
/ (1000 * (uint64_t)base.denom);
|
||||
return (uint64_t)(((double)mach_absolute_time() * base.numer)
|
||||
/ base.denom / 1000);
|
||||
#elif defined(CLOCK_MONOTONIC)
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
|
Loading…
Reference in New Issue
Block a user