Blame


1 3baa2617 2022-02-16 op /*
2 3baa2617 2022-02-16 op * Copyright (c) 2022 Omar Polo <op@openbsd.org>
3 3baa2617 2022-02-16 op *
4 3baa2617 2022-02-16 op * Permission to use, copy, modify, and distribute this software for any
5 3baa2617 2022-02-16 op * purpose with or without fee is hereby granted, provided that the above
6 3baa2617 2022-02-16 op * copyright notice and this permission notice appear in all copies.
7 3baa2617 2022-02-16 op *
8 3baa2617 2022-02-16 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 3baa2617 2022-02-16 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 3baa2617 2022-02-16 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 3baa2617 2022-02-16 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 3baa2617 2022-02-16 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 3baa2617 2022-02-16 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 3baa2617 2022-02-16 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 3baa2617 2022-02-16 op */
16 3baa2617 2022-02-16 op
17 3baa2617 2022-02-16 op #include <sys/types.h>
18 3baa2617 2022-02-16 op #include <sys/queue.h>
19 3baa2617 2022-02-16 op #include <sys/uio.h>
20 3baa2617 2022-02-16 op
21 3baa2617 2022-02-16 op #include <limits.h>
22 3baa2617 2022-02-16 op
23 3baa2617 2022-02-16 op #include <assert.h>
24 3baa2617 2022-02-16 op #include <errno.h>
25 3baa2617 2022-02-16 op #include <event.h>
26 3baa2617 2022-02-16 op #include <poll.h>
27 3baa2617 2022-02-16 op #include <signal.h>
28 3baa2617 2022-02-16 op #include <sndio.h>
29 14be015f 2022-02-17 op #include <stdio.h>
30 3baa2617 2022-02-16 op #include <stdlib.h>
31 3baa2617 2022-02-16 op #include <stdint.h>
32 3baa2617 2022-02-16 op #include <imsg.h>
33 3baa2617 2022-02-16 op #include <string.h>
34 3baa2617 2022-02-16 op #include <syslog.h>
35 3baa2617 2022-02-16 op #include <unistd.h>
36 3baa2617 2022-02-16 op
37 3baa2617 2022-02-16 op #include "amused.h"
38 3baa2617 2022-02-16 op #include "log.h"
39 3baa2617 2022-02-16 op #include "xmalloc.h"
40 3baa2617 2022-02-16 op
41 5a4b3030 2022-03-09 op struct sio_hdl *hdl;
42 ff06024f 2022-07-08 op struct sio_par par;
43 c0180200 2022-06-10 op struct pollfd *player_pfds;
44 5a4b3030 2022-03-09 op static struct imsgbuf *ibuf;
45 3baa2617 2022-02-16 op
46 c0180200 2022-06-10 op static int stopped = 1;
47 3baa2617 2022-02-16 op static int nextfd = -1;
48 ff06024f 2022-07-08 op static int64_t samples;
49 3baa2617 2022-02-16 op
50 3baa2617 2022-02-16 op volatile sig_atomic_t halted;
51 3baa2617 2022-02-16 op
52 ae335651 2022-07-08 op static void
53 3baa2617 2022-02-16 op player_signal_handler(int signo)
54 3baa2617 2022-02-16 op {
55 3baa2617 2022-02-16 op halted = 1;
56 3baa2617 2022-02-16 op }
57 3baa2617 2022-02-16 op
58 3baa2617 2022-02-16 op int
59 b9d2a697 2022-07-08 op player_setup(unsigned int bits, unsigned int rate, unsigned int channels)
60 3baa2617 2022-02-16 op {
61 4d8a06d4 2022-06-10 op int nfds, fpct;
62 3baa2617 2022-02-16 op
63 a728254f 2022-02-23 op log_debug("%s: bits=%d, rate=%d, channels=%d", __func__,
64 a728254f 2022-02-23 op bits, rate, channels);
65 4d8a06d4 2022-06-10 op
66 4d8a06d4 2022-06-10 op fpct = (rate*5)/100;
67 4d8a06d4 2022-06-10 op
68 4d8a06d4 2022-06-10 op /* don't stop if the parameters are the same */
69 4d8a06d4 2022-06-10 op if (bits == par.bits && channels == par.pchan &&
70 f5237736 2022-06-10 op par.rate - fpct <= rate && rate <= par.rate + fpct) {
71 f5237736 2022-06-10 op if (stopped)
72 f5237736 2022-06-10 op goto start;
73 f5237736 2022-06-10 op return 0;
74 f5237736 2022-06-10 op }
75 3baa2617 2022-02-16 op
76 c0180200 2022-06-10 op again:
77 c0180200 2022-06-10 op if (!stopped) {
78 c0180200 2022-06-10 op sio_stop(hdl);
79 c0180200 2022-06-10 op stopped = 1;
80 c0180200 2022-06-10 op }
81 3baa2617 2022-02-16 op
82 3baa2617 2022-02-16 op sio_initpar(&par);
83 e24324f1 2022-02-21 op par.bits = bits;
84 3baa2617 2022-02-16 op par.rate = rate;
85 7fc831ea 2022-02-18 op par.pchan = channels;
86 c0180200 2022-06-10 op if (!sio_setpar(hdl, &par)) {
87 c0180200 2022-06-10 op if (errno == EAGAIN) {
88 463ce879 2022-06-10 op nfds = sio_pollfd(hdl, player_pfds + 1, POLLOUT);
89 c0180200 2022-06-10 op if (poll(player_pfds + 1, nfds, INFTIM) == -1)
90 c0180200 2022-06-10 op fatal("poll");
91 c0180200 2022-06-10 op goto again;
92 c0180200 2022-06-10 op }
93 f002c42a 2022-05-09 op log_warnx("invalid params (bits=%d, rate=%d, channels=%d",
94 f002c42a 2022-05-09 op bits, rate, channels);
95 7fc831ea 2022-02-18 op return -1;
96 7fc831ea 2022-02-18 op }
97 c0180200 2022-06-10 op if (!sio_getpar(hdl, &par)) {
98 c0180200 2022-06-10 op log_warnx("can't get params");
99 c0180200 2022-06-10 op return -1;
100 c0180200 2022-06-10 op }
101 7fc831ea 2022-02-18 op
102 e24324f1 2022-02-21 op if (par.bits != bits || par.pchan != channels) {
103 7fc831ea 2022-02-18 op log_warnx("failed to set params");
104 3baa2617 2022-02-16 op return -1;
105 3baa2617 2022-02-16 op }
106 3baa2617 2022-02-16 op
107 3baa2617 2022-02-16 op /* TODO: check the sample rate? */
108 3baa2617 2022-02-16 op
109 f5237736 2022-06-10 op start:
110 3baa2617 2022-02-16 op if (!sio_start(hdl)) {
111 3baa2617 2022-02-16 op log_warn("sio_start");
112 3baa2617 2022-02-16 op return -1;
113 3baa2617 2022-02-16 op }
114 c0180200 2022-06-10 op stopped = 0;
115 3baa2617 2022-02-16 op return 0;
116 ff06024f 2022-07-08 op }
117 ff06024f 2022-07-08 op
118 ff06024f 2022-07-08 op void
119 ff06024f 2022-07-08 op player_setduration(int64_t duration)
120 ff06024f 2022-07-08 op {
121 ff06024f 2022-07-08 op int64_t seconds;
122 ff06024f 2022-07-08 op
123 ff06024f 2022-07-08 op seconds = duration / par.rate;
124 ff06024f 2022-07-08 op imsg_compose(ibuf, IMSG_LEN, 0, 0, -1, &seconds, sizeof(seconds));
125 ff06024f 2022-07-08 op imsg_flush(ibuf);
126 ff06024f 2022-07-08 op }
127 ff06024f 2022-07-08 op
128 ae335651 2022-07-08 op static void
129 ff06024f 2022-07-08 op player_onmove(void *arg, int delta)
130 ff06024f 2022-07-08 op {
131 ff06024f 2022-07-08 op static int64_t reported;
132 ff06024f 2022-07-08 op int64_t sec;
133 ff06024f 2022-07-08 op
134 ff06024f 2022-07-08 op samples += delta;
135 ff06024f 2022-07-08 op if (llabs(samples - reported) >= par.rate) {
136 ff06024f 2022-07-08 op reported = samples;
137 ff06024f 2022-07-08 op sec = samples / par.rate;
138 ff06024f 2022-07-08 op
139 ff06024f 2022-07-08 op imsg_compose(ibuf, IMSG_POS, 0, 0, -1, &sec, sizeof(sec));
140 ff06024f 2022-07-08 op imsg_flush(ibuf);
141 ff06024f 2022-07-08 op }
142 3baa2617 2022-02-16 op }
143 3baa2617 2022-02-16 op
144 791d3db3 2022-07-09 op void
145 791d3db3 2022-07-09 op player_setpos(int64_t pos)
146 791d3db3 2022-07-09 op {
147 791d3db3 2022-07-09 op samples = pos;
148 791d3db3 2022-07-09 op player_onmove(NULL, 0);
149 791d3db3 2022-07-09 op }
150 791d3db3 2022-07-09 op
151 3baa2617 2022-02-16 op /* process only one message */
152 ae335651 2022-07-08 op static int
153 791d3db3 2022-07-09 op player_dispatch(int64_t *s)
154 3baa2617 2022-02-16 op {
155 791d3db3 2022-07-09 op struct player_seek seek;
156 fc4a38af 2022-05-19 op struct pollfd pfd;
157 3baa2617 2022-02-16 op struct imsg imsg;
158 3baa2617 2022-02-16 op ssize_t n;
159 3baa2617 2022-02-16 op int ret;
160 3baa2617 2022-02-16 op
161 3baa2617 2022-02-16 op if (halted != 0)
162 3baa2617 2022-02-16 op return IMSG_STOP;
163 fc4a38af 2022-05-19 op
164 926ee836 2022-05-19 op again:
165 3baa2617 2022-02-16 op if ((n = imsg_get(ibuf, &imsg)) == -1)
166 3baa2617 2022-02-16 op fatal("imsg_get");
167 926ee836 2022-05-19 op if (n == 0) {
168 926ee836 2022-05-19 op pfd.fd = ibuf->fd;
169 926ee836 2022-05-19 op pfd.events = POLLIN;
170 926ee836 2022-05-19 op if (poll(&pfd, 1, INFTIM) == -1)
171 926ee836 2022-05-19 op fatal("poll");
172 926ee836 2022-05-19 op if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
173 926ee836 2022-05-19 op fatal("imsg_read");
174 926ee836 2022-05-19 op if (n == 0)
175 926ee836 2022-05-19 op fatalx("pipe closed");
176 926ee836 2022-05-19 op goto again;
177 926ee836 2022-05-19 op }
178 3baa2617 2022-02-16 op
179 3baa2617 2022-02-16 op ret = imsg.hdr.type;
180 3baa2617 2022-02-16 op switch (imsg.hdr.type) {
181 3baa2617 2022-02-16 op case IMSG_PLAY:
182 6e4f8947 2022-06-09 op if (nextfd != -1)
183 6e4f8947 2022-06-09 op fatalx("track already enqueued");
184 6e4f8947 2022-06-09 op if ((nextfd = imsg.fd) == -1)
185 6e4f8947 2022-06-09 op fatalx("%s: got invalid file descriptor", __func__);
186 6e4f8947 2022-06-09 op log_debug("song enqueued");
187 3baa2617 2022-02-16 op ret = IMSG_STOP;
188 3baa2617 2022-02-16 op break;
189 3baa2617 2022-02-16 op case IMSG_RESUME:
190 3baa2617 2022-02-16 op case IMSG_PAUSE:
191 3baa2617 2022-02-16 op case IMSG_STOP:
192 3baa2617 2022-02-16 op break;
193 791d3db3 2022-07-09 op case IMSG_CTL_SEEK:
194 791d3db3 2022-07-09 op if (s == NULL)
195 791d3db3 2022-07-09 op break;
196 791d3db3 2022-07-09 op if (IMSG_DATA_SIZE(imsg) != sizeof(seek))
197 791d3db3 2022-07-09 op fatalx("wrong size for seek ctl");
198 791d3db3 2022-07-09 op memcpy(&seek, imsg.data, sizeof(seek));
199 791d3db3 2022-07-09 op log_debug("got to seek: {%lld, %d}", seek.offset,
200 791d3db3 2022-07-09 op seek.relative);
201 791d3db3 2022-07-09 op *s = seek.offset * par.rate;
202 791d3db3 2022-07-09 op if (seek.relative)
203 791d3db3 2022-07-09 op *s += samples;
204 791d3db3 2022-07-09 op if (*s < 0)
205 791d3db3 2022-07-09 op *s = -1;
206 791d3db3 2022-07-09 op break;
207 3baa2617 2022-02-16 op default:
208 3baa2617 2022-02-16 op fatalx("unknown imsg %d", imsg.hdr.type);
209 3baa2617 2022-02-16 op }
210 3baa2617 2022-02-16 op
211 fd90976c 2022-06-09 op imsg_free(&imsg);
212 3baa2617 2022-02-16 op return ret;
213 3baa2617 2022-02-16 op }
214 3baa2617 2022-02-16 op
215 ae335651 2022-07-08 op static void
216 17ef54d6 2022-06-22 op player_senderr(const char *errstr)
217 3baa2617 2022-02-16 op {
218 17ef54d6 2022-06-22 op size_t len = 0;
219 17ef54d6 2022-06-22 op
220 17ef54d6 2022-06-22 op if (errstr != NULL)
221 17ef54d6 2022-06-22 op len = strlen(errstr) + 1;
222 17ef54d6 2022-06-22 op
223 17ef54d6 2022-06-22 op imsg_compose(ibuf, IMSG_ERR, 0, 0, -1, errstr, len);
224 3baa2617 2022-02-16 op imsg_flush(ibuf);
225 3baa2617 2022-02-16 op }
226 3baa2617 2022-02-16 op
227 ae335651 2022-07-08 op static void
228 3baa2617 2022-02-16 op player_sendeof(void)
229 3baa2617 2022-02-16 op {
230 3baa2617 2022-02-16 op imsg_compose(ibuf, IMSG_EOF, 0, 0, -1, NULL, 0);
231 3baa2617 2022-02-16 op imsg_flush(ibuf);
232 3baa2617 2022-02-16 op }
233 3baa2617 2022-02-16 op
234 ae335651 2022-07-08 op static int
235 17ef54d6 2022-06-22 op player_playnext(const char **errstr)
236 3baa2617 2022-02-16 op {
237 bf19b03e 2022-05-09 op static char buf[512];
238 bf19b03e 2022-05-09 op ssize_t r;
239 3baa2617 2022-02-16 op int fd = nextfd;
240 3baa2617 2022-02-16 op
241 3baa2617 2022-02-16 op assert(nextfd != -1);
242 3baa2617 2022-02-16 op nextfd = -1;
243 3baa2617 2022-02-16 op
244 ff06024f 2022-07-08 op /* reset samples and set position to zero */
245 ff06024f 2022-07-08 op samples = 0;
246 ff06024f 2022-07-08 op imsg_compose(ibuf, IMSG_POS, 0, 0, -1, &samples, sizeof(samples));
247 ff06024f 2022-07-08 op imsg_flush(ibuf);
248 ff06024f 2022-07-08 op
249 bf19b03e 2022-05-09 op r = read(fd, buf, sizeof(buf));
250 bf19b03e 2022-05-09 op
251 bf19b03e 2022-05-09 op /* 8 byte is the larger magic number */
252 bf19b03e 2022-05-09 op if (r < 8) {
253 17ef54d6 2022-06-22 op *errstr = "read failed";
254 bf19b03e 2022-05-09 op goto err;
255 bf19b03e 2022-05-09 op }
256 bf19b03e 2022-05-09 op
257 bf19b03e 2022-05-09 op if (lseek(fd, 0, SEEK_SET) == -1) {
258 17ef54d6 2022-06-22 op *errstr = "lseek failed";
259 bf19b03e 2022-05-09 op goto err;
260 bf19b03e 2022-05-09 op }
261 bf19b03e 2022-05-09 op
262 bf19b03e 2022-05-09 op if (memcmp(buf, "fLaC", 4) == 0)
263 17ef54d6 2022-06-22 op return play_flac(fd, errstr);
264 bf19b03e 2022-05-09 op if (memcmp(buf, "ID3", 3) == 0 ||
265 bf19b03e 2022-05-09 op memcmp(buf, "\xFF\xFB", 2) == 0)
266 17ef54d6 2022-06-22 op return play_mp3(fd, errstr);
267 bf19b03e 2022-05-09 op if (memmem(buf, r, "OpusHead", 8) != NULL)
268 17ef54d6 2022-06-22 op return play_opus(fd, errstr);
269 bf19b03e 2022-05-09 op if (memmem(buf, r, "OggS", 4) != NULL)
270 17ef54d6 2022-06-22 op return play_oggvorbis(fd, errstr);
271 25cb72fb 2022-02-22 op
272 17ef54d6 2022-06-22 op *errstr = "unknown file type";
273 bf19b03e 2022-05-09 op err:
274 184600a8 2022-05-09 op close(fd);
275 06412529 2022-05-09 op return -1;
276 3baa2617 2022-02-16 op }
277 3baa2617 2022-02-16 op
278 ae335651 2022-07-08 op static int
279 791d3db3 2022-07-09 op player_pause(int64_t *s)
280 3baa2617 2022-02-16 op {
281 3baa2617 2022-02-16 op int r;
282 3baa2617 2022-02-16 op
283 791d3db3 2022-07-09 op r = player_dispatch(s);
284 3baa2617 2022-02-16 op return r == IMSG_RESUME;
285 3baa2617 2022-02-16 op }
286 3baa2617 2022-02-16 op
287 ae335651 2022-07-08 op static int
288 791d3db3 2022-07-09 op player_shouldstop(int64_t *s)
289 3baa2617 2022-02-16 op {
290 791d3db3 2022-07-09 op switch (player_dispatch(s)) {
291 3baa2617 2022-02-16 op case IMSG_PAUSE:
292 791d3db3 2022-07-09 op if (player_pause(s))
293 3baa2617 2022-02-16 op break;
294 3baa2617 2022-02-16 op /* fallthrough */
295 3baa2617 2022-02-16 op case IMSG_STOP:
296 3baa2617 2022-02-16 op return 1;
297 3baa2617 2022-02-16 op }
298 3baa2617 2022-02-16 op
299 3baa2617 2022-02-16 op return 0;
300 3baa2617 2022-02-16 op }
301 3baa2617 2022-02-16 op
302 3baa2617 2022-02-16 op int
303 791d3db3 2022-07-09 op play(const void *buf, size_t len, int64_t *s)
304 2139c525 2022-03-09 op {
305 c0180200 2022-06-10 op size_t w;
306 c0180200 2022-06-10 op int nfds, revents, r;
307 c0180200 2022-06-10 op
308 791d3db3 2022-07-09 op *s = -1;
309 c0180200 2022-06-10 op while (len != 0) {
310 c0180200 2022-06-10 op nfds = sio_pollfd(hdl, player_pfds + 1, POLLOUT);
311 c0180200 2022-06-10 op r = poll(player_pfds, nfds + 1, INFTIM);
312 c0180200 2022-06-10 op if (r == -1)
313 c0180200 2022-06-10 op fatal("poll");
314 c0180200 2022-06-10 op
315 c0180200 2022-06-10 op if (player_pfds[0].revents & (POLLHUP|POLLIN)) {
316 791d3db3 2022-07-09 op if (player_shouldstop(s)) {
317 c0180200 2022-06-10 op sio_flush(hdl);
318 c0180200 2022-06-10 op stopped = 1;
319 c0180200 2022-06-10 op return 0;
320 c0180200 2022-06-10 op }
321 c0180200 2022-06-10 op }
322 c0180200 2022-06-10 op
323 c0180200 2022-06-10 op revents = sio_revents(hdl, player_pfds + 1);
324 c0180200 2022-06-10 op if (revents & POLLHUP)
325 c0180200 2022-06-10 op fatalx("sndio hang-up");
326 c0180200 2022-06-10 op if (revents & POLLOUT) {
327 c0180200 2022-06-10 op w = sio_write(hdl, buf, len);
328 c0180200 2022-06-10 op len -= w;
329 c0180200 2022-06-10 op buf += w;
330 c0180200 2022-06-10 op }
331 c0180200 2022-06-10 op }
332 c0180200 2022-06-10 op
333 2139c525 2022-03-09 op return 1;
334 2139c525 2022-03-09 op }
335 2139c525 2022-03-09 op
336 2139c525 2022-03-09 op int
337 3baa2617 2022-02-16 op player(int debug, int verbose)
338 3baa2617 2022-02-16 op {
339 fc4a38af 2022-05-19 op int r;
340 fc4a38af 2022-05-19 op
341 3baa2617 2022-02-16 op log_init(debug, LOG_DAEMON);
342 3baa2617 2022-02-16 op log_setverbose(verbose);
343 3baa2617 2022-02-16 op
344 3baa2617 2022-02-16 op setproctitle("player");
345 3baa2617 2022-02-16 op log_procinit("player");
346 3baa2617 2022-02-16 op
347 3baa2617 2022-02-16 op #if 0
348 3baa2617 2022-02-16 op {
349 3baa2617 2022-02-16 op static int attached;
350 3baa2617 2022-02-16 op
351 3baa2617 2022-02-16 op while (!attached)
352 3baa2617 2022-02-16 op sleep(1);
353 3baa2617 2022-02-16 op }
354 3baa2617 2022-02-16 op #endif
355 3baa2617 2022-02-16 op
356 aecca17c 2022-06-10 op if ((hdl = sio_open(SIO_DEVANY, SIO_PLAY, 1)) == NULL)
357 aecca17c 2022-06-10 op fatal("sio_open");
358 3baa2617 2022-02-16 op
359 ff06024f 2022-07-08 op sio_onmove(hdl, player_onmove, NULL);
360 ff06024f 2022-07-08 op
361 c0180200 2022-06-10 op /* allocate one extra for imsg */
362 c0180200 2022-06-10 op player_pfds = calloc(sio_nfds(hdl) + 1, sizeof(*player_pfds));
363 c0180200 2022-06-10 op if (player_pfds == NULL)
364 c0180200 2022-06-10 op fatal("calloc");
365 c0180200 2022-06-10 op
366 c0180200 2022-06-10 op player_pfds[0].events = POLLIN;
367 c0180200 2022-06-10 op player_pfds[0].fd = 3;
368 c0180200 2022-06-10 op
369 3baa2617 2022-02-16 op ibuf = xmalloc(sizeof(*ibuf));
370 3baa2617 2022-02-16 op imsg_init(ibuf, 3);
371 3baa2617 2022-02-16 op
372 3baa2617 2022-02-16 op signal(SIGINT, player_signal_handler);
373 3baa2617 2022-02-16 op signal(SIGTERM, player_signal_handler);
374 3baa2617 2022-02-16 op
375 3baa2617 2022-02-16 op signal(SIGHUP, SIG_IGN);
376 3baa2617 2022-02-16 op signal(SIGPIPE, SIG_IGN);
377 3baa2617 2022-02-16 op
378 251e00ff 2022-03-10 op if (pledge("stdio recvfd audio", NULL) == -1)
379 3baa2617 2022-02-16 op fatal("pledge");
380 3baa2617 2022-02-16 op
381 3baa2617 2022-02-16 op while (!halted) {
382 17ef54d6 2022-06-22 op const char *errstr = NULL;
383 17ef54d6 2022-06-22 op
384 3baa2617 2022-02-16 op while (nextfd == -1)
385 791d3db3 2022-07-09 op player_dispatch(NULL);
386 06412529 2022-05-09 op
387 17ef54d6 2022-06-22 op r = player_playnext(&errstr);
388 239029b6 2022-05-09 op if (r == -1)
389 17ef54d6 2022-06-22 op player_senderr(errstr);
390 239029b6 2022-05-09 op if (r == 0)
391 06412529 2022-05-09 op player_sendeof();
392 3baa2617 2022-02-16 op }
393 3baa2617 2022-02-16 op
394 3baa2617 2022-02-16 op return 0;
395 3baa2617 2022-02-16 op }