projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add btr support to the oggdec filter.
[paraslash.git]
/
wma_afh.c
diff --git
a/wma_afh.c
b/wma_afh.c
index
94e6848
..
9cf8e50
100644
(file)
--- a/
wma_afh.c
+++ b/
wma_afh.c
@@
-185,16
+185,15
@@
next:
}
}
}
}
-static void set_chunk_tv(int
num_frames, int num_chunks
, int frequency,
+static void set_chunk_tv(int
frames_per_chunk
, int frequency,
struct timeval *result)
{
struct timeval *result)
{
- uint64_t x = (uint64_t)
num_frames
* 1000 * 1000
- / frequency
/ num_chunks
;
+ uint64_t x = (uint64_t)
frames_per_chunk * 2048
* 1000 * 1000
+ / frequency;
result->tv_sec = x / 1000 / 1000;
result->tv_usec = x % (1000 * 1000);
result->tv_sec = x / 1000 / 1000;
result->tv_usec = x % (1000 * 1000);
- PARA_INFO_LOG("%d chunks, chunk time: %lums\n", num_chunks,
- tv2ms(result));
+ PARA_INFO_LOG("chunk time: %lums\n", tv2ms(result));
}
/* Must be called on a frame boundary. */
}
/* Must be called on a frame boundary. */
@@
-202,7
+201,7
@@
static int wma_make_chunk_table(char *buf, size_t buf_size, int block_align,
struct afh_info *afhi)
{
const uint8_t *f, *start = (uint8_t *)buf;
struct afh_info *afhi)
{
const uint8_t *f, *start = (uint8_t *)buf;
- int
i,
j, frames_per_chunk;
+ int j, frames_per_chunk;
size_t ct_size = 250;
int ret, count = 0, num_frames, num_superframes;
size_t ct_size = 250;
int ret, count = 0, num_frames, num_superframes;
@@
-217,9
+216,8
@@
static int wma_make_chunk_table(char *buf, size_t buf_size, int block_align,
goto fail;
afhi->seconds_total = num_frames * 2048 /* FIXME */
/ afhi->frequency;
goto fail;
afhi->seconds_total = num_frames * 2048 /* FIXME */
/ afhi->frequency;
- frames_per_chunk = num_frames / num_superframes;
+ frames_per_chunk = num_frames / num_superframes
/ 2
;
PARA_INFO_LOG("%d frames per chunk\n", frames_per_chunk);
PARA_INFO_LOG("%d frames per chunk\n", frames_per_chunk);
- i = 0;
j = 1;
FOR_EACH_FRAME(f, start, buf_size, block_align) {
count += f[WMA_FRAME_SKIP] & 0x0f;
j = 1;
FOR_EACH_FRAME(f, start, buf_size, block_align) {
count += f[WMA_FRAME_SKIP] & 0x0f;
@@
-235,7
+233,7
@@
static int wma_make_chunk_table(char *buf, size_t buf_size, int block_align,
}
}
afhi->chunks_total = j;
}
}
afhi->chunks_total = j;
- set_chunk_tv(
num_frames * 2048, j + 10 /* FIXME */
, afhi->frequency, &afhi->chunk_tv);
+ set_chunk_tv(
frames_per_chunk
, afhi->frequency, &afhi->chunk_tv);
return 1;
fail:
free(afhi->chunk_table);
return 1;
fail:
free(afhi->chunk_table);