History

avformat/whip: use av_dict_set_int for int

Timo Rothenpieler committed 1 year ago

Commit 8f3ecc91 parent cdc03241 file · +3 −6Browse files

Unified · Split

libavformat/whip.c+3−6
@@ -1221,7 +1221,6 @@ static int ice_dtls_handshake(AVFormatContext *s) · 1220 unmodified lines
12211221 int64_t starttime = av_gettime(), now;
12221222 WHIPContext *whip = s->priv_data;
12231223 AVDictionary *opts = NULL;
1224− char str[8];
12251224 char buf[256], *cert_buf = NULL, *key_buf = NULL;
12261225
12271226 if (whip->state < WHIP_STATE_UDP_CONNECTED || !whip->udp) {
@@ -1288,8 +1287,7 @@ next_packet: · 60 unmodified lines
12881287 whip->ice_ufrag_remote, whip->ice_ufrag_local, ret, ELAPSED(whip->whip_starttime, av_gettime()));
12891288
12901289 ff_url_join(buf, sizeof(buf), "dtls", NULL, whip->ice_host, whip->ice_port, NULL);
1291− snprintf(str, sizeof(str), "%d", whip->pkt_size);
1292− av_dict_set(&opts, "mtu", str, 0);
1290+ av_dict_set_int(&opts, "mtu", whip->pkt_size, 0);
12931291 if (whip->cert_file) {
12941292 av_dict_set(&opts, "cert_file", whip->cert_file, 0);
12951293 } else
@@ -1299,10 +1297,9 @@ next_packet: · 3 unmodified lines
12991297 av_dict_set(&opts, "key_file", whip->key_file, 0);
13001298 } else
13011299 av_dict_set(&opts, "key_buf", whip->key_buf, 0);
1302−
13031300 av_dict_set(&opts, "fingerprint", whip->dtls_fingerprint, 0);
1304− av_dict_set(&opts, "use_external_udp", "1", 0);
1305− av_dict_set(&opts, "listen", "1", 0);
1301+ av_dict_set_int(&opts, "use_external_udp", 1, 0);
1302+ av_dict_set_int(&opts, "listen", 1, 0);
13061303 /* If got the first binding response, start DTLS handshake. */
13071304 ret = ffurl_open_whitelist(&whip->dtls_uc, buf, AVIO_FLAG_READ_WRITE, &s->interrupt_callback,
13081305 &opts, s->protocol_whitelist, s->protocol_blacklist, NULL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t