projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve help/man page of para_filter.
[paraslash.git]
/
mp3dec_filter.c
diff --git
a/mp3dec_filter.c
b/mp3dec_filter.c
index d3265d4ff84c2b804ec9fd421f7e4694b70cf9f1..8fa7094480285b5768c1f0cf991a559e13a5f1c7 100644
(file)
--- a/
mp3dec_filter.c
+++ b/
mp3dec_filter.c
@@
-10,6
+10,7
@@
#include "mp3dec_filter.cmdline.h"
#include "list.h"
#include "sched.h"
#include "mp3dec_filter.cmdline.h"
#include "list.h"
#include "sched.h"
+#include "ggo.h"
#include "filter.h"
#include "error.h"
#include <mad.h>
#include "filter.h"
#include "error.h"
#include <mad.h>
@@
-33,9
+34,9
@@
static ssize_t mp3dec(char *inbuffer, size_t len, struct filter_node *fn)
{
int i, ret;
struct private_mp3dec_data *pmd = fn->private_data;
{
int i, ret;
struct private_mp3dec_data *pmd = fn->private_data;
- size_t copy = PARA_MIN(len, 4096);
+ size_t copy = PARA_MIN(len,
(size_t)
4096);
- if (fn->loaded
> fn->bufsize * 4 / 5
)
+ if (fn->loaded
+ 16384 > fn->bufsize
)
return 0;
mad_stream_buffer(&pmd->stream, (unsigned char *) inbuffer, copy);
pmd->stream.error = 0;
return 0;
mad_stream_buffer(&pmd->stream, (unsigned char *) inbuffer, copy);
pmd->stream.error = 0;
@@
-78,7
+79,7
@@
next_frame:
PARA_ERROR_LOG("output buffer full: %zd\n", fn->loaded);
return -E_MP3DEC_OVERRUN;
}
PARA_ERROR_LOG("output buffer full: %zd\n", fn->loaded);
return -E_MP3DEC_OVERRUN;
}
- if (fn->loaded
<= fn->bufsize * 4 / 5
)
+ if (fn->loaded
+ 16384 <= fn->bufsize
)
goto next_frame;
out:
if (pmd->stream.next_frame) { /* we still have some data */
goto next_frame;
out:
if (pmd->stream.next_frame) { /* we still have some data */
@@
-150,8
+151,17
@@
err:
*/
void mp3dec_filter_init(struct filter *f)
{
*/
void mp3dec_filter_init(struct filter *f)
{
+ struct mp3dec_filter_args_info dummy;
+
+ mp3dec_cmdline_parser_init(&dummy);
f->open = mp3dec_open;
f->convert = mp3dec;
f->close = mp3dec_close;
f->parse_config = mp3dec_parse_config;
f->open = mp3dec_open;
f->convert = mp3dec;
f->close = mp3dec_close;
f->parse_config = mp3dec_parse_config;
+ f->help = (struct ggo_help) {
+ .purpose = mp3dec_filter_args_info_purpose,
+ .usage = mp3dec_filter_args_info_usage,
+ .short_help = mp3dec_filter_args_info_help,
+ .detailed_help = mp3dec_filter_args_info_detailed_help
+ };
}
}