Unified · Split
| @@ -1,6 +1,8 @@ | |||
| 1 | #include <stdatomic.h> | 1 | #include <stdatomic.h> |
| 2 | #include <time.h> | 2 | #include <time.h> |
| 3 | 3 | ||
| 4 | #include <libmpv/client.h> | ||
| 5 | |||
| 4 | #include "common.h" | 6 | #include "common.h" |
| 5 | #include "global.h" | 7 | #include "global.h" |
| 6 | #include "misc/linked_list.h" | 8 | #include "misc/linked_list.h" |
| @@ -23,8 +23,6 @@ · 22 unmodified lines | |||
| 23 | #include <sys/mman.h> | 23 | #include <sys/mman.h> |
| 24 | #include <unistd.h> | 24 | #include <unistd.h> |
| 25 | 25 | ||
| 26 | #include <libmpv/client.h> | ||
| 27 | |||
| 28 | #include "common.h" | 26 | #include "common.h" |
| 29 | 27 | ||
| 30 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) | 28 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
| @@ -20,8 +20,6 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #include <unistd.h> | 21 | #include <unistd.h> |
| 22 | 22 | ||
| 23 | #include <libmpv/client.h> | ||
| 24 | |||
| 25 | #include "common.h" | 23 | #include "common.h" |
| 26 | 24 | ||
| 27 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) | 25 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
| @@ -15,8 +15,6 @@ · 14 unmodified lines | |||
| 15 | * License along with mpv. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with mpv. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <libmpv/client.h> | ||
| 19 | |||
| 20 | #include "common.h" | 18 | #include "common.h" |
| 21 | 19 | ||
| 22 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) | 20 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
| @@ -28,6 +28,8 @@ · 27 unmodified lines | |||
| 28 | #include <fcntl.h> | 28 | #include <fcntl.h> |
| 29 | #include <assert.h> | 29 | #include <assert.h> |
| 30 | 30 | ||
| 31 | #include <libmpv/client.h> | ||
| 32 | |||
| 31 | #include "osdep/io.h" | 33 | #include "osdep/io.h" |
| 32 | #include "misc/rendezvous.h" | 34 | #include "misc/rendezvous.h" |
| 33 | 35 | ||
| @@ -15,6 +15,8 @@ · 14 unmodified lines | |||
| 15 | * License along with mpv. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with mpv. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <libmpv/client.h> | ||
| 19 | |||
| 18 | #include "common/msg.h" | 20 | #include "common/msg.h" |
| 19 | #include "input/input.h" | 21 | #include "input/input.h" |
| 20 | #include "misc/json.h" | 22 | #include "misc/json.h" |
| @@ -48,6 +48,8 @@ · 47 unmodified lines | |||
| 48 | #include <inttypes.h> | 48 | #include <inttypes.h> |
| 49 | #include <assert.h> | 49 | #include <assert.h> |
| 50 | 50 | ||
| 51 | #include <libmpv/client.h> | ||
| 52 | |||
| 51 | #include "common/common.h" | 53 | #include "common/common.h" |
| 52 | #include "misc/bstr.h" | 54 | #include "misc/bstr.h" |
| 53 | #include "misc/ctype.h" | 55 | #include "misc/ctype.h" |
| @@ -18,12 +18,10 @@ · 17 unmodified lines | |||
| 18 | #ifndef MP_JSON_H | 18 | #ifndef MP_JSON_H |
| 19 | #define MP_JSON_H | 19 | #define MP_JSON_H |
| 20 | 20 | ||
| 21 | // We reuse mpv_node. | ||
| 22 | #include "libmpv/client.h" | ||
| 23 | |||
| 24 | #define MAX_JSON_DEPTH 50 | 21 | #define MAX_JSON_DEPTH 50 |
| 25 | 22 | ||
| 26 | struct bstr; | 23 | struct bstr; |
| 24 | struct mpv_node; | ||
| 27 | 25 | ||
| 28 | int json_parse(void *ta_parent, struct mpv_node *dst, char **src, int max_depth); | 26 | int json_parse(void *ta_parent, struct mpv_node *dst, char **src, int max_depth); |
| 29 | int json_append(struct bstr *b, const struct mpv_node *src, int indent); | 27 | int json_append(struct bstr *b, const struct mpv_node *src, int indent); |
| @@ -1,7 +1,10 @@ | |||
| 1 | #include "common/common.h" | ||
| 2 | |||
| 3 | #include "node.h" | 1 | #include "node.h" |
| 4 | 2 | ||
| 3 | #include <libmpv/client.h> | ||
| 4 | |||
| 5 | #include "common/common.h" | ||
| 6 | #include "bstr.h" | ||
| 7 | |||
| 5 | // Init a node with the given format. If parent is not NULL, it is set as | 8 | // Init a node with the given format. If parent is not NULL, it is set as |
| 6 | // parent allocation according to m_option_type_node rules (which means | 9 | // parent allocation according to m_option_type_node rules (which means |
| 7 | // the mpv_node_list allocs are used for chaining the TA allocations). | 10 | // the mpv_node_list allocs are used for chaining the TA allocations). |
| @@ -117,7 +120,7 @@ mpv_node *node_map_bget(mpv_node *src, struct bstr key) · 109 unmodified lines | |||
| 117 | 120 | ||
| 118 | // Note: for MPV_FORMAT_NODE_MAP, this (incorrectly) takes the order into | 121 | // Note: for MPV_FORMAT_NODE_MAP, this (incorrectly) takes the order into |
| 119 | // account, instead of treating it as set. | 122 | // account, instead of treating it as set. |
| 120 | bool equal_mpv_value(const void *a, const void *b, mpv_format format) | 123 | bool equal_mpv_value(const void *a, const void *b, int format) |
| 121 | { | 124 | { |
| 122 | switch (format) { | 125 | switch (format) { |
| 123 | case MPV_FORMAT_NONE: | 126 | case MPV_FORMAT_NONE: |
| @@ -1,21 +1,24 @@ | |||
| 1 | #ifndef MP_MISC_NODE_H_ | 1 | #ifndef MP_MISC_NODE_H_ |
| 2 | #define MP_MISC_NODE_H_ | 2 | #define MP_MISC_NODE_H_ |
| 3 | 3 | ||
| 4 | #include "libmpv/client.h" | 4 | #include <stdbool.h> |
| 5 | #include "misc/bstr.h" | 5 | #include <stdint.h> |
| 6 | |||
| 7 | struct bstr; | ||
| 8 | struct mpv_node; | ||
| 6 | 9 | ||
| 7 | void node_init(struct mpv_node *dst, int format, struct mpv_node *parent); | 10 | void node_init(struct mpv_node *dst, int format, struct mpv_node *parent); |
| 8 | struct mpv_node *node_array_add(struct mpv_node *dst, int format); | 11 | struct mpv_node *node_array_add(struct mpv_node *dst, int format); |
| 9 | struct mpv_node *node_map_add(struct mpv_node *dst, const char *key, int format); | 12 | struct mpv_node *node_map_add(struct mpv_node *dst, const char *key, int format); |
| 10 | struct mpv_node *node_map_badd(struct mpv_node *dst, struct bstr key, int format); | 13 | struct mpv_node *node_map_badd(struct mpv_node *dst, struct bstr key, int format); |
| 11 | void node_map_add_string(struct mpv_node *dst, const char *key, const char *val); | 14 | void node_map_add_string(struct mpv_node *dst, const char *key, const char *val); |
| 12 | void node_map_add_bstr(struct mpv_node *dst, const char *key, bstr val); | 15 | void node_map_add_bstr(struct mpv_node *dst, const char *key, struct bstr val); |
| 13 | void node_map_add_int64(struct mpv_node *dst, const char *key, int64_t v); | 16 | void node_map_add_int64(struct mpv_node *dst, const char *key, int64_t v); |
| 14 | void node_map_add_double(struct mpv_node *dst, const char *key, double v); | 17 | void node_map_add_double(struct mpv_node *dst, const char *key, double v); |
| 15 | void node_map_add_flag(struct mpv_node *dst, const char *key, bool v); | 18 | void node_map_add_flag(struct mpv_node *dst, const char *key, bool v); |
| 16 | mpv_node *node_map_get(mpv_node *src, const char *key); | 19 | struct mpv_node *node_map_get(struct mpv_node *src, const char *key); |
| 17 | mpv_node *node_map_bget(mpv_node *src, struct bstr key); | 20 | struct mpv_node *node_map_bget(struct mpv_node *src, struct bstr key); |
| 18 | bool equal_mpv_value(const void *a, const void *b, mpv_format format); | 21 | bool equal_mpv_value(const void *a, const void *b, int format); |
| 19 | bool equal_mpv_node(const struct mpv_node *a, const struct mpv_node *b); | 22 | bool equal_mpv_node(const struct mpv_node *a, const struct mpv_node *b); |
| 20 | 23 | ||
| 21 | #endif | 24 | #endif |
| @@ -4,7 +4,6 @@ · 3 unmodified lines | |||
| 4 | #include <stdint.h> | 4 | #include <stdint.h> |
| 5 | #include <stdbool.h> | 5 | #include <stdbool.h> |
| 6 | 6 | ||
| 7 | #include "libmpv/client.h" | ||
| 8 | #include "libmpv/stream_cb.h" | 7 | #include "libmpv/stream_cb.h" |
| 9 | #include "misc/bstr.h" | 8 | #include "misc/bstr.h" |
| 10 | 9 | ||
| @@ -21,8 +21,6 @@ · 20 unmodified lines | |||
| 21 | #include <stdatomic.h> | 21 | #include <stdatomic.h> |
| 22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
| 23 | 23 | ||
| 24 | #include "libmpv/client.h" | ||
| 25 | |||
| 26 | #include "audio/aframe.h" | 24 | #include "audio/aframe.h" |
| 27 | #include "clipboard/clipboard.h" | 25 | #include "clipboard/clipboard.h" |
| 28 | #include "common/common.h" | 26 | #include "common/common.h" |
| @@ -60,7 +60,6 @@ · 59 unmodified lines | |||
| 60 | 60 | ||
| 61 | #include "core.h" | 61 | #include "core.h" |
| 62 | #include "command.h" | 62 | #include "command.h" |
| 63 | #include "libmpv/client.h" | ||
| 64 | 63 | ||
| 65 | // Called from the demuxer thread if a new packet is available, or other changes. | 64 | // Called from the demuxer thread if a new packet is available, or other changes. |
| 66 | static void wakeup_demux(void *pctx) | 65 | static void wakeup_demux(void *pctx) |
| @@ -1,3 +1,5 @@ | |||
| 1 | #include <libmpv/client.h> | ||
| 2 | |||
| 1 | #include "misc/json.h" | 3 | #include "misc/json.h" |
| 2 | #include "misc/node.h" | 4 | #include "misc/node.h" |
| 3 | #include "test_utils.h" | 5 | #include "test_utils.h" |
| @@ -16,13 +16,14 @@ · 15 unmodified lines | |||
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <inttypes.h> | 18 | #include <inttypes.h> |
| 19 | #include <libmpv/client.h> | ||
| 20 | #include <stdarg.h> | 19 | #include <stdarg.h> |
| 21 | #include <stdbool.h> | 20 | #include <stdbool.h> |
| 22 | #include <stdio.h> | 21 | #include <stdio.h> |
| 23 | #include <stdlib.h> | 22 | #include <stdlib.h> |
| 24 | #include <string.h> | 23 | #include <string.h> |
| 25 | 24 | ||
| 25 | #include <libmpv/client.h> | ||
| 26 | |||
| 26 | // Stolen from osdep/compiler.h | 27 | // Stolen from osdep/compiler.h |
| 27 | #ifdef __GNUC__ | 28 | #ifdef __GNUC__ |
| 28 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) | 29 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) |
| @@ -16,7 +16,6 @@ · 15 unmodified lines | |||
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <inttypes.h> | 18 | #include <inttypes.h> |
| 19 | #include <libmpv/client.h> | ||
| 20 | #include <stdarg.h> | 19 | #include <stdarg.h> |
| 21 | #include <stdio.h> | 20 | #include <stdio.h> |
| 22 | #include <stdlib.h> | 21 | #include <stdlib.h> |
| @@ -29,6 +28,8 @@ · 6 unmodified lines | |||
| 29 | #include <unistd.h> | 28 | #include <unistd.h> |
| 30 | #endif | 29 | #endif |
| 31 | 30 | ||
| 31 | #include <libmpv/client.h> | ||
| 32 | |||
| 32 | // Stolen from osdep/compiler.h | 33 | // Stolen from osdep/compiler.h |
| 33 | #ifdef __GNUC__ | 34 | #ifdef __GNUC__ |
| 34 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) | 35 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) |