bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
Unified · Split
| @@ -20,7 +20,7 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #include <inttypes.h> | 21 | #include <inttypes.h> |
| 22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
| 23 | #include "bstr/bstr.h" | 23 | #include "misc/bstr.h" |
| 24 | 24 | ||
| 25 | #define MP_NUM_CHANNELS 8 | 25 | #define MP_NUM_CHANNELS 8 |
| 26 | 26 | ||
| @@ -37,8 +37,6 @@ · 36 unmodified lines | |||
| 37 | #include "ad.h" | 37 | #include "ad.h" |
| 38 | #include "audio/fmt-conversion.h" | 38 | #include "audio/fmt-conversion.h" |
| 39 | 39 | ||
| 40 | #include "compat/libav.h" | ||
| 41 | |||
| 42 | struct priv { | 40 | struct priv { |
| 43 | AVCodecContext *avctx; | 41 | AVCodecContext *avctx; |
| 44 | AVFrame *avframe; | 42 | AVFrame *avframe; |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include "config.h" | 28 | #include "config.h" |
| 29 | #include "common/codecs.h" | 29 | #include "common/codecs.h" |
| 30 | #include "common/msg.h" | 30 | #include "common/msg.h" |
| 31 | #include "bstr/bstr.h" | 31 | #include "misc/bstr.h" |
| 32 | 32 | ||
| 33 | #include "stream/stream.h" | 33 | #include "stream/stream.h" |
| 34 | #include "demux/demux.h" | 34 | #include "demux/demux.h" |
| @@ -20,7 +20,7 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #include "af.h" | 21 | #include "af.h" |
| 22 | #include "audio/format.h" | 22 | #include "audio/format.h" |
| 23 | #include "compat/mpbswap.h" | 23 | #include "osdep/mpbswap.h" |
| 24 | 24 | ||
| 25 | static bool test_conversion(int src_format, int dst_format) | 25 | static bool test_conversion(int src_format, int dst_format) |
| 26 | { | 26 | { |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include <stdbool.h> | 26 | #include <stdbool.h> |
| 27 | 27 | ||
| 28 | #include "osdep/endian.h" | 28 | #include "osdep/endian.h" |
| 29 | #include "bstr/bstr.h" | 29 | #include "misc/bstr.h" |
| 30 | 30 | ||
| 31 | #if BYTE_ORDER == BIG_ENDIAN | 31 | #if BYTE_ORDER == BIG_ENDIAN |
| 32 | #define AF_SELECT_LE_BE(LE, BE) BE | 32 | #define AF_SELECT_LE_BE(LE, BE) BE |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
| 23 | 23 | ||
| 24 | #include "bstr/bstr.h" | 24 | #include "misc/bstr.h" |
| 25 | #include "common/common.h" | 25 | #include "common/common.h" |
| 26 | #include "audio/chmap.h" | 26 | #include "audio/chmap.h" |
| 27 | #include "audio/chmap_sel.h" | 27 | #include "audio/chmap_sel.h" |
| @@ -28,7 +28,6 @@ · 27 unmodified lines | |||
| 28 | #include <libavutil/common.h> | 28 | #include <libavutil/common.h> |
| 29 | #include <libavutil/audioconvert.h> | 29 | #include <libavutil/audioconvert.h> |
| 30 | 30 | ||
| 31 | #include "compat/libav.h" | ||
| 32 | #include "config.h" | 31 | #include "config.h" |
| 33 | #include "options/options.h" | 32 | #include "options/options.h" |
| 34 | #include "common/common.h" | 33 | #include "common/common.h" |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include <mmdeviceapi.h> | 28 | #include <mmdeviceapi.h> |
| 29 | #include <avrt.h> | 29 | #include <avrt.h> |
| 30 | 30 | ||
| 31 | #include "compat/atomics.h" | 31 | #include "osdep/atomics.h" |
| 32 | 32 | ||
| 33 | typedef struct wasapi_state { | 33 | typedef struct wasapi_state { |
| 34 | struct mp_log *log; | 34 | struct mp_log *log; |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | #include "osdep/timer.h" | 31 | #include "osdep/timer.h" |
| 32 | #include "osdep/threads.h" | 32 | #include "osdep/threads.h" |
| 33 | #include "compat/atomics.h" | 33 | #include "osdep/atomics.h" |
| 34 | #include "misc/ring.h" | 34 | #include "misc/ring.h" |
| 35 | 35 | ||
| 36 | /* | 36 | /* |
| @@ -35,7 +35,7 @@ · 34 unmodified lines | |||
| 35 | 35 | ||
| 36 | #include "osdep/threads.h" | 36 | #include "osdep/threads.h" |
| 37 | #include "osdep/timer.h" | 37 | #include "osdep/timer.h" |
| 38 | #include "compat/atomics.h" | 38 | #include "osdep/atomics.h" |
| 39 | 39 | ||
| 40 | #include "audio/audio.h" | 40 | #include "audio/audio.h" |
| 41 | #include "audio/audio_buffer.h" | 41 | #include "audio/audio_buffer.h" |
| @@ -17,7 +17,7 @@ · 16 unmodified lines | |||
| 17 | 17 | ||
| 18 | #include <assert.h> | 18 | #include <assert.h> |
| 19 | #include "talloc.h" | 19 | #include "talloc.h" |
| 20 | #include "bstr/bstr.h" | 20 | #include "misc/bstr.h" |
| 21 | #include "common/msg.h" | 21 | #include "common/msg.h" |
| 22 | #include "codecs.h" | 22 | #include "codecs.h" |
| 23 | 23 | ||
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include <libavutil/common.h> | 22 | #include <libavutil/common.h> |
| 23 | 23 | ||
| 24 | #include "talloc.h" | 24 | #include "talloc.h" |
| 25 | #include "bstr/bstr.h" | 25 | #include "misc/bstr.h" |
| 26 | #include "common/common.h" | 26 | #include "common/common.h" |
| 27 | 27 | ||
| 28 | #define appendf(ptr, ...) \ | 28 | #define appendf(ptr, ...) \ |
| @@ -24,7 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
| 25 | #include <stdint.h> | 25 | #include <stdint.h> |
| 26 | 26 | ||
| 27 | #include "compat/compiler.h" | 27 | #include "osdep/compiler.h" |
| 28 | #include "talloc.h" | 28 | #include "talloc.h" |
| 29 | 29 | ||
| 30 | // double should be able to represent this exactly | 30 | // double should be able to represent this exactly |
| @@ -27,8 +27,8 @@ · 26 unmodified lines | |||
| 27 | 27 | ||
| 28 | #include "talloc.h" | 28 | #include "talloc.h" |
| 29 | 29 | ||
| 30 | #include "bstr/bstr.h" | 30 | #include "misc/bstr.h" |
| 31 | #include "compat/atomics.h" | 31 | #include "osdep/atomics.h" |
| 32 | #include "common/common.h" | 32 | #include "common/common.h" |
| 33 | #include "common/global.h" | 33 | #include "common/global.h" |
| 34 | #include "misc/ring.h" | 34 | #include "misc/ring.h" |
| @@ -24,7 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
| 25 | #include <stdint.h> | 25 | #include <stdint.h> |
| 26 | 26 | ||
| 27 | #include "compat/compiler.h" | 27 | #include "osdep/compiler.h" |
| 28 | 28 | ||
| 29 | struct mp_log; | 29 | struct mp_log; |
| 30 | 30 | ||
| @@ -19,7 +19,7 @@ · 18 unmodified lines | |||
| 19 | #define MPLAYER_PLAYLIST_H | 19 | #define MPLAYER_PLAYLIST_H |
| 20 | 20 | ||
| 21 | #include <stdbool.h> | 21 | #include <stdbool.h> |
| 22 | #include "bstr/bstr.h" | 22 | #include "misc/bstr.h" |
| 23 | 23 | ||
| 24 | struct playlist_param { | 24 | struct playlist_param { |
| 25 | bstr name, value; | 25 | bstr name, value; |
| @@ -17,7 +17,7 @@ · 16 unmodified lines | |||
| 17 | 17 | ||
| 18 | #include <libavutil/dict.h> | 18 | #include <libavutil/dict.h> |
| 19 | #include "tags.h" | 19 | #include "tags.h" |
| 20 | #include "bstr/bstr.h" | 20 | #include "misc/bstr.h" |
| 21 | 21 | ||
| 22 | void mp_tags_set_str(struct mp_tags *tags, const char *key, const char *value) | 22 | void mp_tags_set_str(struct mp_tags *tags, const char *key, const char *value) |
| 23 | { | 23 | { |
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef MP_TAGS_H | 1 | #ifndef MP_TAGS_H |
| 2 | #define MP_TAGS_H | 2 | #define MP_TAGS_H |
| 3 | 3 | ||
| 4 | #include "bstr/bstr.h" | 4 | #include "misc/bstr.h" |
| 5 | 5 | ||
| 6 | struct mp_tags { | 6 | struct mp_tags { |
| 7 | char **keys; | 7 | char **keys; |
| @@ -1,27 +0,0 @@ | |||
| 1 | #ifndef MPV_COMPILER_H | ||
| 2 | #define MPV_COMPILER_H | ||
| 3 | |||
| 4 | #define MP_EXPAND_ARGS(...) __VA_ARGS__ | ||
| 5 | |||
| 6 | #ifdef __GNUC__ | ||
| 7 | |||
| 8 | #define MP_NORETURN __attribute__((noreturn)) | ||
| 9 | |||
| 10 | /** Use gcc attribute to check printf fns. a1 is the 1-based index of | ||
| 11 | * the parameter containing the format, and a2 the index of the first | ||
| 12 | * argument. **/ | ||
| 13 | #ifdef __MINGW32__ | ||
| 14 | // MinGW maps "printf" to the non-standard MSVCRT functions, even if | ||
| 15 | // __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf", | ||
| 16 | // which isn't necessarily available on other GCC compatible compilers. | ||
| 17 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2))) | ||
| 18 | #else | ||
| 19 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (printf, a1, a2))) | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #else | ||
| 23 | #define PRINTF_ATTRIBUTE(a1, a2) | ||
| 24 | #define MP_NORETURN | ||
| 25 | #endif | ||
| 26 | |||
| 27 | #endif | ||
| @@ -1,24 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * This file is part of mpv. | ||
| 3 | * | ||
| 4 | * mpv is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * MPlayer is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along | ||
| 15 | * with MPlayer; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef MPV_LIBAV_COMPAT_H | ||
| 20 | #define MPV_LIBAV_COMPAT_H | ||
| 21 | |||
| 22 | // There's nothing here. But for how long? | ||
| 23 | |||
| 24 | #endif /* MPV_LIBAV_COMPAT_H */ | ||
| @@ -25,7 +25,7 @@ · 24 unmodified lines | |||
| 25 | #include <string.h> | 25 | #include <string.h> |
| 26 | #include <stdbool.h> | 26 | #include <stdbool.h> |
| 27 | 27 | ||
| 28 | #include "bstr/bstr.h" | 28 | #include "misc/bstr.h" |
| 29 | #include "common/common.h" | 29 | #include "common/common.h" |
| 30 | #include "common/tags.h" | 30 | #include "common/tags.h" |
| 31 | #include "packet.h" | 31 | #include "packet.h" |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
| 23 | #include <string.h> | 23 | #include <string.h> |
| 24 | 24 | ||
| 25 | #include "bstr/bstr.h" | 25 | #include "misc/bstr.h" |
| 26 | #include "demux.h" | 26 | #include "demux.h" |
| 27 | #include "stream/stream.h" | 27 | #include "stream/stream.h" |
| 28 | 28 | ||
| @@ -39,13 +39,12 @@ · 38 unmodified lines | |||
| 39 | # include <libavutil/display.h> | 39 | # include <libavutil/display.h> |
| 40 | #endif | 40 | #endif |
| 41 | #include <libavutil/opt.h> | 41 | #include <libavutil/opt.h> |
| 42 | #include "compat/libav.h" | ||
| 43 | 42 | ||
| 44 | #include "options/options.h" | 43 | #include "options/options.h" |
| 45 | #include "common/msg.h" | 44 | #include "common/msg.h" |
| 46 | #include "common/tags.h" | 45 | #include "common/tags.h" |
| 47 | #include "common/av_common.h" | 46 | #include "common/av_common.h" |
| 48 | #include "bstr/bstr.h" | 47 | #include "misc/bstr.h" |
| 49 | 48 | ||
| 50 | #include "stream/stream.h" | 49 | #include "stream/stream.h" |
| 51 | #include "demux.h" | 50 | #include "demux.h" |
| @@ -44,7 +44,7 @@ · 43 unmodified lines | |||
| 44 | #include "talloc.h" | 44 | #include "talloc.h" |
| 45 | #include "common/av_common.h" | 45 | #include "common/av_common.h" |
| 46 | #include "options/options.h" | 46 | #include "options/options.h" |
| 47 | #include "bstr/bstr.h" | 47 | #include "misc/bstr.h" |
| 48 | #include "stream/stream.h" | 48 | #include "stream/stream.h" |
| 49 | #include "demux.h" | 49 | #include "demux.h" |
| 50 | #include "stheader.h" | 50 | #include "stheader.h" |
| @@ -34,7 +34,7 @@ · 33 unmodified lines | |||
| 34 | #include "talloc.h" | 34 | #include "talloc.h" |
| 35 | #include "ebml.h" | 35 | #include "ebml.h" |
| 36 | #include "stream/stream.h" | 36 | #include "stream/stream.h" |
| 37 | #include "compat/mpbswap.h" | 37 | #include "osdep/mpbswap.h" |
| 38 | #include "common/msg.h" | 38 | #include "common/msg.h" |
| 39 | 39 | ||
| 40 | // Whether the id is a known Matroska level 1 element (allowed as element on | 40 | // Whether the id is a known Matroska level 1 element (allowed as element on |
| @@ -24,7 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
| 25 | 25 | ||
| 26 | #include "stream/stream.h" | 26 | #include "stream/stream.h" |
| 27 | #include "bstr/bstr.h" | 27 | #include "misc/bstr.h" |
| 28 | 28 | ||
| 29 | struct mp_log; | 29 | struct mp_log; |
| 30 | 30 | ||
| @@ -19,7 +19,7 @@ · 18 unmodified lines | |||
| 19 | #ifndef MPLAYER_MS_HDR_H | 19 | #ifndef MPLAYER_MS_HDR_H |
| 20 | #define MPLAYER_MS_HDR_H | 20 | #define MPLAYER_MS_HDR_H |
| 21 | 21 | ||
| 22 | #include "compat/mpbswap.h" | 22 | #include "osdep/mpbswap.h" |
| 23 | #include "video/img_fourcc.h" | 23 | #include "video/img_fourcc.h" |
| 24 | 24 | ||
| 25 | // These structs must be binary-compatible to the native win32 types, | 25 | // These structs must be binary-compatible to the native win32 types, |
| @@ -18,7 +18,7 @@ · 17 unmodified lines | |||
| 18 | 18 | ||
| 19 | #include <stddef.h> | 19 | #include <stddef.h> |
| 20 | 20 | ||
| 21 | #include "bstr/bstr.h" | 21 | #include "misc/bstr.h" |
| 22 | #include "common/common.h" | 22 | #include "common/common.h" |
| 23 | #include "common/msg.h" | 23 | #include "common/msg.h" |
| 24 | #include "options/m_option.h" | 24 | #include "options/m_option.h" |
| @@ -15,7 +15,7 @@ · 14 unmodified lines | |||
| 15 | * with mpv. If not, see <http://www.gnu.org/licenses/>. | 15 | * with mpv. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "bstr/bstr.h" | 18 | #include "misc/bstr.h" |
| 19 | 19 | ||
| 20 | struct input_ctx; | 20 | struct input_ctx; |
| 21 | 21 | ||
| @@ -48,7 +48,7 @@ · 47 unmodified lines | |||
| 48 | #include "options/path.h" | 48 | #include "options/path.h" |
| 49 | #include "talloc.h" | 49 | #include "talloc.h" |
| 50 | #include "options/options.h" | 50 | #include "options/options.h" |
| 51 | #include "bstr/bstr.h" | 51 | #include "misc/bstr.h" |
| 52 | #include "stream/stream.h" | 52 | #include "stream/stream.h" |
| 53 | #include "common/common.h" | 53 | #include "common/common.h" |
| 54 | 54 | ||
| @@ -20,7 +20,7 @@ · 19 unmodified lines | |||
| 20 | #define MPLAYER_INPUT_H | 20 | #define MPLAYER_INPUT_H |
| 21 | 21 | ||
| 22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
| 23 | #include "bstr/bstr.h" | 23 | #include "misc/bstr.h" |
| 24 | 24 | ||
| 25 | #include "cmd_list.h" | 25 | #include "cmd_list.h" |
| 26 | #include "cmd_parse.h" | 26 | #include "cmd_parse.h" |
| @@ -20,7 +20,7 @@ · 19 unmodified lines | |||
| 20 | #include <string.h> | 20 | #include <string.h> |
| 21 | #include <strings.h> | 21 | #include <strings.h> |
| 22 | 22 | ||
| 23 | #include "bstr/bstr.h" | 23 | #include "misc/bstr.h" |
| 24 | #include "common/common.h" | 24 | #include "common/common.h" |
| 25 | #include "common/msg.h" | 25 | #include "common/msg.h" |
| 26 | 26 | ||
| @@ -10,7 +10,7 @@ · 9 unmodified lines | |||
| 10 | #endif | 10 | #endif |
| 11 | 11 | ||
| 12 | #include "common/msg.h" | 12 | #include "common/msg.h" |
| 13 | #include "bstr/bstr.h" | 13 | #include "misc/bstr.h" |
| 14 | #include "osdep/io.h" | 14 | #include "osdep/io.h" |
| 15 | #include "input.h" | 15 | #include "input.h" |
| 16 | #include "cmd_parse.h" | 16 | #include "cmd_parse.h" |
File renamed without changes.
File renamed without changes.
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | #define MP_CHARSET_CONV_H | 2 | #define MP_CHARSET_CONV_H |
| 3 | 3 | ||
| 4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
| 5 | #include "bstr/bstr.h" | 5 | #include "misc/bstr.h" |
| 6 | 6 | ||
| 7 | struct mp_log; | 7 | struct mp_log; |
| 8 | 8 | ||
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | #include <libavutil/common.h> | 21 | #include <libavutil/common.h> |
| 22 | #include <assert.h> | 22 | #include <assert.h> |
| 23 | #include "talloc.h" | 23 | #include "talloc.h" |
| 24 | #include "compat/atomics.h" | 24 | #include "osdep/atomics.h" |
| 25 | #include "ring.h" | 25 | #include "ring.h" |
| 26 | 26 | ||
| 27 | struct mp_ring { | 27 | struct mp_ring { |
| @@ -146,7 +146,6 @@ SOURCES = audio/audio.c \ · 145 unmodified lines | |||
| 146 | audio/out/ao_pcm.c \ | 146 | audio/out/ao_pcm.c \ |
| 147 | audio/out/pull.c \ | 147 | audio/out/pull.c \ |
| 148 | audio/out/push.c \ | 148 | audio/out/push.c \ |
| 149 | bstr/bstr.c \ | ||
| 150 | common/av_common.c \ | 149 | common/av_common.c \ |
| 151 | common/av_log.c \ | 150 | common/av_log.c \ |
| 152 | common/codecs.c \ | 151 | common/codecs.c \ |
| @@ -175,6 +174,7 @@ SOURCES = audio/audio.c \ · 22 unmodified lines | |||
| 175 | input/input.c \ | 174 | input/input.c \ |
| 176 | input/keycodes.c \ | 175 | input/keycodes.c \ |
| 177 | input/pipe.c \ | 176 | input/pipe.c \ |
| 177 | misc/bstr.c \ | ||
| 178 | misc/charset_conv.c \ | 178 | misc/charset_conv.c \ |
| 179 | misc/dispatch.c \ | 179 | misc/dispatch.c \ |
| 180 | misc/rendezvous.c \ | 180 | misc/rendezvous.c \ |
| @@ -303,7 +303,6 @@ DIRS = . \ · 122 unmodified lines | |||
| 303 | audio/decode \ | 303 | audio/decode \ |
| 304 | audio/filter \ | 304 | audio/filter \ |
| 305 | audio/out \ | 305 | audio/out \ |
| 306 | bstr \ | ||
| 307 | common \ | 306 | common \ |
| 308 | compat \ | 307 | compat \ |
| 309 | input \ | 308 | input \ |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include <stddef.h> | 22 | #include <stddef.h> |
| 23 | #include <stdbool.h> | 23 | #include <stdbool.h> |
| 24 | 24 | ||
| 25 | #include "bstr/bstr.h" | 25 | #include "misc/bstr.h" |
| 26 | 26 | ||
| 27 | // m_config provides an API to manipulate the config variables in MPlayer. | 27 | // m_config provides an API to manipulate the config variables in MPlayer. |
| 28 | // It makes use of the Options API to provide a context stack that | 28 | // It makes use of the Options API to provide a context stack that |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include <stddef.h> | 23 | #include <stddef.h> |
| 24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
| 25 | 25 | ||
| 26 | #include "bstr/bstr.h" | 26 | #include "misc/bstr.h" |
| 27 | #include "audio/chmap.h" | 27 | #include "audio/chmap.h" |
| 28 | 28 | ||
| 29 | // m_option allows to parse, print and copy data of various types. | 29 | // m_option allows to parse, print and copy data of various types. |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #define MPLAYER_PATH_H | 22 | #define MPLAYER_PATH_H |
| 23 | 23 | ||
| 24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
| 25 | #include "bstr/bstr.h" | 25 | #include "misc/bstr.h" |
| 26 | 26 | ||
| 27 | struct mpv_global; | 27 | struct mpv_global; |
| 28 | 28 | ||
File renamed without changes.
| @@ -1 +1,27 @@ | |||
| 1 | #include "compat/compiler.h" | 1 | #ifndef MPV_COMPILER_H |
| 2 | #define MPV_COMPILER_H | ||
| 3 | |||
| 4 | #define MP_EXPAND_ARGS(...) __VA_ARGS__ | ||
| 5 | |||
| 6 | #ifdef __GNUC__ | ||
| 7 | |||
| 8 | #define MP_NORETURN __attribute__((noreturn)) | ||
| 9 | |||
| 10 | /** Use gcc attribute to check printf fns. a1 is the 1-based index of | ||
| 11 | * the parameter containing the format, and a2 the index of the first | ||
| 12 | * argument. **/ | ||
| 13 | #ifdef __MINGW32__ | ||
| 14 | // MinGW maps "printf" to the non-standard MSVCRT functions, even if | ||
| 15 | // __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf", | ||
| 16 | // which isn't necessarily available on other GCC compatible compilers. | ||
| 17 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2))) | ||
| 18 | #else | ||
| 19 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (printf, a1, a2))) | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #else | ||
| 23 | #define PRINTF_ATTRIBUTE(a1, a2) | ||
| 24 | #define MP_NORETURN | ||
| 25 | #endif | ||
| 26 | |||
| 27 | #endif | ||
File renamed without changes.
| @@ -43,7 +43,7 @@ · 42 unmodified lines | |||
| 43 | #include <unistd.h> | 43 | #include <unistd.h> |
| 44 | 44 | ||
| 45 | #include "common/common.h" | 45 | #include "common/common.h" |
| 46 | #include "bstr/bstr.h" | 46 | #include "misc/bstr.h" |
| 47 | #include "input/input.h" | 47 | #include "input/input.h" |
| 48 | #include "input/keycodes.h" | 48 | #include "input/keycodes.h" |
| 49 | #include "misc/ctype.h" | 49 | #include "misc/ctype.h" |
| @@ -39,7 +39,7 @@ · 38 unmodified lines | |||
| 39 | #include "options/m_option.h" | 39 | #include "options/m_option.h" |
| 40 | #include "input/input.h" | 40 | #include "input/input.h" |
| 41 | #include "options/path.h" | 41 | #include "options/path.h" |
| 42 | #include "bstr/bstr.h" | 42 | #include "misc/bstr.h" |
| 43 | #include "osdep/timer.h" | 43 | #include "osdep/timer.h" |
| 44 | #include "osdep/threads.h" | 44 | #include "osdep/threads.h" |
| 45 | #include "sub/osd.h" | 45 | #include "sub/osd.h" |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include "screenshot.h" | 28 | #include "screenshot.h" |
| 29 | #include "core.h" | 29 | #include "core.h" |
| 30 | #include "command.h" | 30 | #include "command.h" |
| 31 | #include "bstr/bstr.h" | 31 | #include "misc/bstr.h" |
| 32 | #include "common/msg.h" | 32 | #include "common/msg.h" |
| 33 | #include "options/path.h" | 33 | #include "options/path.h" |
| 34 | #include "video/mp_image.h" | 34 | #include "video/mp_image.h" |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | |||
| 30 | #include "common/common.h" | 30 | #include "common/common.h" |
| 31 | #include "common/msg.h" | 31 | #include "common/msg.h" |
| 32 | #include "options/path.h" | 32 | #include "options/path.h" |
| 33 | #include "bstr/bstr.h" | 33 | #include "misc/bstr.h" |
| 34 | #include "core.h" | 34 | #include "core.h" |
| 35 | #include "client.h" | 35 | #include "client.h" |
| 36 | #include "libmpv/client.h" | 36 | #include "libmpv/client.h" |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include "common/msg.h" | 27 | #include "common/msg.h" |
| 28 | #include "demux/demux.h" | 28 | #include "demux/demux.h" |
| 29 | #include "options/path.h" | 29 | #include "options/path.h" |
| 30 | #include "bstr/bstr.h" | 30 | #include "misc/bstr.h" |
| 31 | #include "common/common.h" | 31 | #include "common/common.h" |
| 32 | #include "stream/stream.h" | 32 | #include "stream/stream.h" |
| 33 | 33 | ||
| @@ -34,7 +34,7 @@ · 33 unmodified lines | |||
| 34 | #include "common/msg.h" | 34 | #include "common/msg.h" |
| 35 | #include "demux/demux.h" | 35 | #include "demux/demux.h" |
| 36 | #include "options/path.h" | 36 | #include "options/path.h" |
| 37 | #include "bstr/bstr.h" | 37 | #include "misc/bstr.h" |
| 38 | #include "common/common.h" | 38 | #include "common/common.h" |
| 39 | #include "common/playlist.h" | 39 | #include "common/playlist.h" |
| 40 | #include "stream/stream.h" | 40 | #include "stream/stream.h" |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include "common/msg.h" | 27 | #include "common/msg.h" |
| 28 | #include "demux/demux.h" | 28 | #include "demux/demux.h" |
| 29 | #include "options/path.h" | 29 | #include "options/path.h" |
| 30 | #include "bstr/bstr.h" | 30 | #include "misc/bstr.h" |
| 31 | #include "common/common.h" | 31 | #include "common/common.h" |
| 32 | #include "stream/stream.h" | 32 | #include "stream/stream.h" |
| 33 | 33 | ||
| @@ -31,7 +31,7 @@ · 30 unmodified lines | |||
| 31 | #include <assert.h> | 31 | #include <assert.h> |
| 32 | 32 | ||
| 33 | #include <libavutil/common.h> | 33 | #include <libavutil/common.h> |
| 34 | #include "compat/mpbswap.h" | 34 | #include "osdep/mpbswap.h" |
| 35 | 35 | ||
| 36 | #include "talloc.h" | 36 | #include "talloc.h" |
| 37 | 37 | ||
| @@ -39,7 +39,7 @@ · 1 unmodified line | |||
| 39 | 39 | ||
| 40 | #include "common/common.h" | 40 | #include "common/common.h" |
| 41 | #include "common/global.h" | 41 | #include "common/global.h" |
| 42 | #include "bstr/bstr.h" | 42 | #include "misc/bstr.h" |
| 43 | #include "common/msg.h" | 43 | #include "common/msg.h" |
| 44 | #include "options/options.h" | 44 | #include "options/options.h" |
| 45 | #include "options/path.h" | 45 | #include "options/path.h" |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include <sys/types.h> | 27 | #include <sys/types.h> |
| 28 | #include <fcntl.h> | 28 | #include <fcntl.h> |
| 29 | 29 | ||
| 30 | #include "bstr/bstr.h" | 30 | #include "misc/bstr.h" |
| 31 | 31 | ||
| 32 | enum streamtype { | 32 | enum streamtype { |
| 33 | STREAMTYPE_GENERIC = 0, | 33 | STREAMTYPE_GENERIC = 0, |
| @@ -46,7 +46,7 @@ · 45 unmodified lines | |||
| 46 | #include "options/m_option.h" | 46 | #include "options/m_option.h" |
| 47 | #include "options/m_config.h" | 47 | #include "options/m_config.h" |
| 48 | #include "options/options.h" | 48 | #include "options/options.h" |
| 49 | #include "compat/mpbswap.h" | 49 | #include "osdep/mpbswap.h" |
| 50 | 50 | ||
| 51 | #include "common/msg.h" | 51 | #include "common/msg.h" |
| 52 | 52 | ||
| @@ -31,7 +31,7 @@ · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | #include "cookies.h" | 32 | #include "cookies.h" |
| 33 | 33 | ||
| 34 | #include "bstr/bstr.h" | 34 | #include "misc/bstr.h" |
| 35 | #include "talloc.h" | 35 | #include "talloc.h" |
| 36 | 36 | ||
| 37 | struct stream_lavf_params *stream_lavf_opts; | 37 | struct stream_lavf_params *stream_lavf_opts; |
| @@ -25,7 +25,7 @@ · 24 unmodified lines | |||
| 25 | #include "config.h" | 25 | #include "config.h" |
| 26 | 26 | ||
| 27 | #include "talloc.h" | 27 | #include "talloc.h" |
| 28 | #include "bstr/bstr.h" | 28 | #include "misc/bstr.h" |
| 29 | #include "common/common.h" | 29 | #include "common/common.h" |
| 30 | #include "common/msg.h" | 30 | #include "common/msg.h" |
| 31 | #include "osd.h" | 31 | #include "osd.h" |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include "talloc.h" | 27 | #include "talloc.h" |
| 28 | #include "common/msg.h" | 28 | #include "common/msg.h" |
| 29 | #include "common/av_common.h" | 29 | #include "common/av_common.h" |
| 30 | #include "bstr/bstr.h" | 30 | #include "misc/bstr.h" |
| 31 | #include "sd.h" | 31 | #include "sd.h" |
| 32 | 32 | ||
| 33 | #define HAVE_AV_WEBVTT (LIBAVCODEC_VERSION_MICRO >= 100) | 33 | #define HAVE_AV_WEBVTT (LIBAVCODEC_VERSION_MICRO >= 100) |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | #include <inttypes.h> | 21 | #include <inttypes.h> |
| 22 | #include <assert.h> | 22 | #include <assert.h> |
| 23 | 23 | ||
| 24 | #include "bstr/bstr.h" | 24 | #include "misc/bstr.h" |
| 25 | #include "sd.h" | 25 | #include "sd.h" |
| 26 | 26 | ||
| 27 | /* | 27 | /* |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include <libavutil/common.h> | 27 | #include <libavutil/common.h> |
| 28 | 28 | ||
| 29 | #include "common/msg.h" | 29 | #include "common/msg.h" |
| 30 | #include "bstr/bstr.h" | 30 | #include "misc/bstr.h" |
| 31 | #include "sd.h" | 31 | #include "sd.h" |
| 32 | 32 | ||
| 33 | struct line { | 33 | struct line { |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | 28 | ||
| 29 | #include "common/common.h" | 29 | #include "common/common.h" |
| 30 | #include "common/msg.h" | 30 | #include "common/msg.h" |
| 31 | #include "bstr/bstr.h" | 31 | #include "misc/bstr.h" |
| 32 | #include "misc/ctype.h" | 32 | #include "misc/ctype.h" |
| 33 | #include "sd.h" | 33 | #include "sd.h" |
| 34 | 34 | ||
| @@ -2,6 +2,6 @@ · 1 unmodified line | |||
| 2 | #include <stdio.h> | 2 | #include <stdio.h> |
| 3 | #include <stdarg.h> | 3 | #include <stdarg.h> |
| 4 | 4 | ||
| 5 | #include "compat/compiler.h" | 5 | #include "osdep/compiler.h" |
| 6 | 6 | ||
| 7 | #include "ta/ta_talloc.h" | 7 | #include "ta/ta_talloc.h" |
| @@ -28,17 +28,15 @@ · 27 unmodified lines | |||
| 28 | #include <libavutil/intreadwrite.h> | 28 | #include <libavutil/intreadwrite.h> |
| 29 | #include <libavutil/pixdesc.h> | 29 | #include <libavutil/pixdesc.h> |
| 30 | 30 | ||
| 31 | #include "compat/libav.h" | ||
| 32 | |||
| 33 | #include "talloc.h" | 31 | #include "talloc.h" |
| 34 | #include "config.h" | 32 | #include "config.h" |
| 35 | #include "common/msg.h" | 33 | #include "common/msg.h" |
| 36 | #include "options/options.h" | 34 | #include "options/options.h" |
| 37 | #include "bstr/bstr.h" | 35 | #include "misc/bstr.h" |
| 38 | #include "common/av_common.h" | 36 | #include "common/av_common.h" |
| 39 | #include "common/codecs.h" | 37 | #include "common/codecs.h" |
| 40 | 38 | ||
| 41 | #include "compat/mpbswap.h" | 39 | #include "osdep/mpbswap.h" |
| 42 | #include "video/fmt-conversion.h" | 40 | #include "video/fmt-conversion.h" |
| 43 | 41 | ||
| 44 | #include "vd.h" | 42 | #include "vd.h" |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include "config.h" | 26 | #include "config.h" |
| 27 | #include "common/msg.h" | 27 | #include "common/msg.h" |
| 28 | #include "options/m_option.h" | 28 | #include "options/m_option.h" |
| 29 | #include "compat/mpbswap.h" | 29 | #include "osdep/mpbswap.h" |
| 30 | 30 | ||
| 31 | #include "video/img_format.h" | 31 | #include "video/img_format.h" |
| 32 | #include "video/mp_image.h" | 32 | #include "video/mp_image.h" |
| @@ -32,7 +32,6 @@ · 31 unmodified lines | |||
| 32 | #include "video/mp_image.h" | 32 | #include "video/mp_image.h" |
| 33 | #include "vf.h" | 33 | #include "vf.h" |
| 34 | #include "video/fmt-conversion.h" | 34 | #include "video/fmt-conversion.h" |
| 35 | #include "compat/mpbswap.h" | ||
| 36 | 35 | ||
| 37 | #include "video/sws_utils.h" | 36 | #include "video/sws_utils.h" |
| 38 | 37 | ||
| @@ -23,8 +23,6 @@ · 22 unmodified lines | |||
| 23 | #include <libavcodec/avcodec.h> | 23 | #include <libavcodec/avcodec.h> |
| 24 | #include <libavutil/mem.h> | 24 | #include <libavutil/mem.h> |
| 25 | 25 | ||
| 26 | #include "compat/libav.h" | ||
| 27 | |||
| 28 | #include "config.h" | 26 | #include "config.h" |
| 29 | 27 | ||
| 30 | #if HAVE_JPEG | 28 | #if HAVE_JPEG |
| @@ -22,8 +22,6 @@ · 21 unmodified lines | |||
| 22 | #include <libavutil/pixfmt.h> | 22 | #include <libavutil/pixfmt.h> |
| 23 | #include <libavutil/pixdesc.h> | 23 | #include <libavutil/pixdesc.h> |
| 24 | 24 | ||
| 25 | #include "compat/libav.h" | ||
| 26 | |||
| 27 | #include "video/img_format.h" | 25 | #include "video/img_format.h" |
| 28 | #include "video/mp_image.h" | 26 | #include "video/mp_image.h" |
| 29 | #include "video/fmt-conversion.h" | 27 | #include "video/fmt-conversion.h" |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include <inttypes.h> | 22 | #include <inttypes.h> |
| 23 | 23 | ||
| 24 | #include "osdep/endian.h" | 24 | #include "osdep/endian.h" |
| 25 | #include "bstr/bstr.h" | 25 | #include "misc/bstr.h" |
| 26 | 26 | ||
| 27 | #if BYTE_ORDER == BIG_ENDIAN | 27 | #if BYTE_ORDER == BIG_ENDIAN |
| 28 | #define MP_SELECT_LE_BE(LE, BE) BE | 28 | #define MP_SELECT_LE_BE(LE, BE) BE |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | #include "config.h" | 31 | #include "config.h" |
| 32 | #include "common/msg.h" | 32 | #include "common/msg.h" |
| 33 | #include "bstr/bstr.h" | 33 | #include "misc/bstr.h" |
| 34 | 34 | ||
| 35 | #include "vo.h" | 35 | #include "vo.h" |
| 36 | #include "video/csputils.h" | 36 | #include "video/csputils.h" |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | 28 | ||
| 29 | #include "stream/stream.h" | 29 | #include "stream/stream.h" |
| 30 | #include "common/common.h" | 30 | #include "common/common.h" |
| 31 | #include "bstr/bstr.h" | 31 | #include "misc/bstr.h" |
| 32 | #include "common/msg.h" | 32 | #include "common/msg.h" |
| 33 | #include "options/m_option.h" | 33 | #include "options/m_option.h" |
| 34 | #include "options/path.h" | 34 | #include "options/path.h" |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | #include "gl_video.h" | 31 | #include "gl_video.h" |
| 32 | 32 | ||
| 33 | #include "bstr/bstr.h" | 33 | #include "misc/bstr.h" |
| 34 | #include "gl_common.h" | 34 | #include "gl_common.h" |
| 35 | #include "gl_osd.h" | 35 | #include "gl_osd.h" |
| 36 | #include "filter_kernels.h" | 36 | #include "filter_kernels.h" |
| @@ -36,7 +36,7 @@ · 35 unmodified lines | |||
| 36 | #include "misc/dispatch.h" | 36 | #include "misc/dispatch.h" |
| 37 | #include "misc/rendezvous.h" | 37 | #include "misc/rendezvous.h" |
| 38 | #include "options/options.h" | 38 | #include "options/options.h" |
| 39 | #include "bstr/bstr.h" | 39 | #include "misc/bstr.h" |
| 40 | #include "vo.h" | 40 | #include "vo.h" |
| 41 | #include "aspect.h" | 41 | #include "aspect.h" |
| 42 | #include "input/input.h" | 42 | #include "input/input.h" |
| @@ -25,7 +25,7 @@ · 24 unmodified lines | |||
| 25 | #include <libswscale/swscale.h> | 25 | #include <libswscale/swscale.h> |
| 26 | 26 | ||
| 27 | #include "config.h" | 27 | #include "config.h" |
| 28 | #include "bstr/bstr.h" | 28 | #include "misc/bstr.h" |
| 29 | #include "osdep/io.h" | 29 | #include "osdep/io.h" |
| 30 | #include "options/path.h" | 30 | #include "options/path.h" |
| 31 | #include "talloc.h" | 31 | #include "talloc.h" |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | #include <stdio.h> | 23 | #include <stdio.h> |
| 24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
| 25 | #include "compat/libav.h" | ||
| 26 | #include "common/common.h" | 25 | #include "common/common.h" |
| 27 | #include "options/options.h" | 26 | #include "options/options.h" |
| 28 | #include "video/fmt-conversion.h" | 27 | #include "video/fmt-conversion.h" |
| @@ -36,7 +36,7 @@ · 35 unmodified lines | |||
| 36 | 36 | ||
| 37 | #include "talloc.h" | 37 | #include "talloc.h" |
| 38 | #include "common/common.h" | 38 | #include "common/common.h" |
| 39 | #include "bstr/bstr.h" | 39 | #include "misc/bstr.h" |
| 40 | #include "common/msg.h" | 40 | #include "common/msg.h" |
| 41 | #include "options/m_config.h" | 41 | #include "options/m_config.h" |
| 42 | #include "vo.h" | 42 | #include "vo.h" |
| @@ -31,7 +31,7 @@ · 30 unmodified lines | |||
| 31 | #include <linux/input.h> | 31 | #include <linux/input.h> |
| 32 | 32 | ||
| 33 | #include "config.h" | 33 | #include "config.h" |
| 34 | #include "bstr/bstr.h" | 34 | #include "misc/bstr.h" |
| 35 | #include "options/options.h" | 35 | #include "options/options.h" |
| 36 | #include "common/msg.h" | 36 | #include "common/msg.h" |
| 37 | #include "talloc.h" | 37 | #include "talloc.h" |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include <limits.h> | 23 | #include <limits.h> |
| 24 | 24 | ||
| 25 | #include "config.h" | 25 | #include "config.h" |
| 26 | #include "bstr/bstr.h" | 26 | #include "misc/bstr.h" |
| 27 | #include "options/options.h" | 27 | #include "options/options.h" |
| 28 | #include "common/common.h" | 28 | #include "common/common.h" |
| 29 | #include "common/msg.h" | 29 | #include "common/msg.h" |
| @@ -155,9 +155,6 @@ def build(ctx): · 154 unmodified lines | |||
| 155 | ( "audio/out/pull.c" ), | 155 | ( "audio/out/pull.c" ), |
| 156 | ( "audio/out/push.c" ), | 156 | ( "audio/out/push.c" ), |
| 157 | 157 | ||
| 158 | ## Bstr | ||
| 159 | ( "bstr/bstr.c" ), | ||
| 160 | |||
| 161 | ## Core | 158 | ## Core |
| 162 | ( "common/av_common.c" ), | 159 | ( "common/av_common.c" ), |
| 163 | ( "common/av_log.c" ), | 160 | ( "common/av_log.c" ), |
| @@ -198,6 +195,7 @@ def build(ctx): · 34 unmodified lines | |||
| 198 | ( "input/lirc.c", "lirc" ), | 195 | ( "input/lirc.c", "lirc" ), |
| 199 | 196 | ||
| 200 | ## Misc | 197 | ## Misc |
| 198 | ( "misc/bstr.c" ), | ||
| 201 | ( "misc/charset_conv.c" ), | 199 | ( "misc/charset_conv.c" ), |
| 202 | ( "misc/dispatch.c" ), | 200 | ( "misc/dispatch.c" ), |
| 203 | ( "misc/ring.c" ), | 201 | ( "misc/ring.c" ), |