From 07a3a53c38ddd8e2ba75c727b334128827bc746f Mon Sep 17 00:00:00 2001 From: stbenz Date: Sun, 24 May 2015 14:30:18 +0200 Subject: [PATCH] transcoding: fix compile when using libav --- src/plumbing/transcoding.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c index b95b66e..f315349 100644 --- a/src/plumbing/transcoding.c +++ b/src/plumbing/transcoding.c @@ -1126,7 +1126,9 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) if (t->t_props.tp_vbitrate < 64) { // encode with specified quality and optimize for low latency // valid values for quality are 1-63, smaller means better quality, use 15 as default - av_dict_set_int(&opts, "crf", (t->t_props.tp_vbitrate == 0 ? 15 : t->t_props.tp_vbitrate), 0); + char valuestr[3]; + snprintf(valuestr, sizeof (valuestr), "%d", t->t_props.tp_vbitrate == 0 ? 15 : t->t_props.tp_vbitrate); + av_dict_set(&opts, "crf", valuestr, 0); // bitrate setting is still required, as it's used as max rate in CQ mode // and set to a very low value by default octx->bit_rate = 25000000; @@ -1154,7 +1156,9 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) if (t->t_props.tp_vbitrate < 64) { // encode with specified quality and optimize for low latency // valid values for quality are 1-51, smaller means better quality, use 15 as default - av_dict_set_int(&opts, "crf", (t->t_props.tp_vbitrate == 0 ? 15 : MIN(51, t->t_props.tp_vbitrate)), 0); + char valuestr[3]; + snprintf(valuestr, sizeof (valuestr), "%d", t->t_props.tp_vbitrate == 0 ? 15 : MIN(51, t->t_props.tp_vbitrate)); + av_dict_set(&opts, "crf", valuestr, 0); // tune "zerolatency" removes as much encoder latency as possible av_dict_set(&opts, "tune", "zerolatency", 0); } else { -- 1.9.1