[FFmpeg-trac] #10520(avfilter:new): Fails to build with pocketsphinx 5
FFmpeg
trac at avcodec.org
Sun Nov 17 20:49:37 EET 2024
#10520: Fails to build with pocketsphinx 5
-------------------------------------+-------------------------------------
Reporter: Samuel | Owner: (none)
Thibault |
Type: defect | Status: new
Priority: normal | Component: avfilter
Version: unspecified | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by aredigg):
Here is a simple diff, but should be tested more
{{{
diff --git a/libavfilter/af_asr.c b/libavfilter/af_asr.c
index 8e8eeb19a7..bba793cfb5 100644
--- a/libavfilter/af_asr.c
+++ b/libavfilter/af_asr.c
@@ -41,7 +41,7 @@ typedef struct ASRContext {
char *logfn;
ps_decoder_t *ps;
- cmd_ln_t *config;
+ ps_config_t *config;
int utt_started;
} ASRContext;
@@ -100,16 +100,16 @@ static av_cold int asr_init(AVFilterContext *ctx)
ASRContext *s = ctx->priv;
const float frate = s->rate;
char *rate = av_asprintf("%f", frate);
- const char *argv[] = { "-logfn", s->logfn,
- "-hmm", s->hmm,
- "-lm", s->lm,
- "-lmctl", s->lmctl,
- "-lmname", s->lmname,
- "-dict", s->dict,
- "-samprate", rate,
- NULL };
-
- s->config = cmd_ln_parse_r(NULL, ps_args(), 14, (char **)argv, 0);
+
+ s->config = ps_config_init(NULL);
+ ps_config_set_str(s->config, "logfn", s->logfn);
+ ps_config_set_str(s->config, "hmm", s->hmm);
+ ps_config_set_str(s->config, "lm", s->lm);
+ ps_config_set_str(s->config, "lmctl", s->lmctl);
+ ps_config_set_str(s->config, "lmname", s->lmname);
+ ps_config_set_str(s->config, "dict", s->dict);
+ ps_config_set_str(s->config, "samprate", rate);
+
av_free(rate);
if (!s->config)
return AVERROR(ENOMEM);
@@ -160,7 +160,7 @@ static av_cold void asr_uninit(AVFilterContext *ctx)
ps_free(s->ps);
s->ps = NULL;
- cmd_ln_free_r(s->config);
+ ps_config_free(s->config);
s->config = NULL;
}
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10520#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list