diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/av_common.c | 14 | ||||
-rw-r--r-- | common/av_common.h | 14 | ||||
-rw-r--r-- | common/av_log.c | 11 | ||||
-rw-r--r-- | common/codecs.c | 14 | ||||
-rw-r--r-- | common/codecs.h | 14 | ||||
-rw-r--r-- | common/common.c | 28 | ||||
-rw-r--r-- | common/common.h | 7 | ||||
-rw-r--r-- | common/playlist.c | 14 | ||||
-rw-r--r-- | common/playlist.h | 14 | ||||
-rw-r--r-- | common/tags.c | 14 | ||||
-rw-r--r-- | common/version.c | 14 |
11 files changed, 85 insertions, 73 deletions
diff --git a/common/av_common.c b/common/av_common.c index c1b188474a..8b979cabba 100644 --- a/common/av_common.c +++ b/common/av_common.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> diff --git a/common/av_common.h b/common/av_common.h index 0b0260982f..e9df328fbf 100644 --- a/common/av_common.h +++ b/common/av_common.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MP_AVCOMMON_H diff --git a/common/av_log.c b/common/av_log.c index 05542cd15a..7e0b271c81 100644 --- a/common/av_log.c +++ b/common/av_log.c @@ -36,15 +36,12 @@ #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h> +#include <libavfilter/avfilter.h> #if HAVE_LIBAVDEVICE #include <libavdevice/avdevice.h> #endif -#if HAVE_LIBAVFILTER -#include <libavfilter/avfilter.h> -#endif - #if HAVE_LIBAVRESAMPLE #include <libavresample/avresample.h> #endif @@ -161,10 +158,8 @@ void init_libav(struct mpv_global *global) avcodec_register_all(); av_register_all(); avformat_network_init(); - -#if HAVE_LIBAVFILTER avfilter_register_all(); -#endif + #if HAVE_LIBAVDEVICE avdevice_register_all(); #endif @@ -196,9 +191,7 @@ void print_libav_versions(struct mp_log *log, int v) {"libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version()}, {"libavformat", LIBAVFORMAT_VERSION_INT, avformat_version()}, {"libswscale", LIBSWSCALE_VERSION_INT, swscale_version()}, -#if HAVE_LIBAVFILTER {"libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version()}, -#endif #if HAVE_LIBAVRESAMPLE {"libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version()}, #endif diff --git a/common/codecs.c b/common/codecs.c index da0bd69db4..c0d99eb959 100644 --- a/common/codecs.c +++ b/common/codecs.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> diff --git a/common/codecs.h b/common/codecs.h index a262ed6582..17316c85e9 100644 --- a/common/codecs.h +++ b/common/codecs.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MP_CODECS_H diff --git a/common/common.c b/common/common.c index 829dbde50c..eead096d5a 100644 --- a/common/common.c +++ b/common/common.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #include <stdarg.h> @@ -25,6 +25,7 @@ #include "misc/bstr.h" #include "misc/ctype.h" #include "common/common.h" +#include "osdep/strnlen.h" #define appendf(ptr, ...) \ do {(*(ptr)) = talloc_asprintf_append_buffer(*(ptr), __VA_ARGS__);} while(0) @@ -187,9 +188,20 @@ static bool mp_parse_escape(void *talloc_ctx, bstr *dst, bstr *code) } if (code->start[0] == 'u' && code->len >= 5) { bstr num = bstr_splice(*code, 1, 5); - int c = bstrtoll(num, &num, 16); + uint32_t c = bstrtoll(num, &num, 16); if (num.len) return false; + if (c >= 0xd800 && c <= 0xdbff) { + if (code->len < 5 + 6 // udddd + \udddd + || code->start[5] != '\\' || code->start[6] != 'u') + return false; + *code = bstr_cut(*code, 5 + 1); + bstr num2 = bstr_splice(*code, 1, 5); + uint32_t c2 = bstrtoll(num2, &num2, 16); + if (num2.len || c2 < 0xdc00 || c2 > 0xdfff) + return false; + c = ((c - 0xd800) << 10) + 0x10000 + (c2 - 0xdc00); + } mp_append_utf8_bstr(talloc_ctx, dst, c); *code = bstr_cut(*code, 5); return true; diff --git a/common/common.h b/common/common.h index 8edfc96d23..4b7da54dbd 100644 --- a/common/common.h +++ b/common/common.h @@ -57,6 +57,13 @@ enum stream_type { STREAM_TYPE_COUNT, }; +enum { + DATA_OK = 1, + DATA_WAIT = 0, + DATA_AGAIN = -1, + DATA_EOF = -2, +}; + extern const char *const mpv_version; extern const char *const mpv_builddate; diff --git a/common/playlist.c b/common/playlist.c index 5b91c3c60c..4c003c5f21 100644 --- a/common/playlist.c +++ b/common/playlist.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> diff --git a/common/playlist.h b/common/playlist.h index b2861b5230..d35fff6df3 100644 --- a/common/playlist.h +++ b/common/playlist.h @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MPLAYER_PLAYLIST_H diff --git a/common/tags.c b/common/tags.c index 35543444f1..29459d09e3 100644 --- a/common/tags.c +++ b/common/tags.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #include <stddef.h> diff --git a/common/version.c b/common/version.c index af110fa09c..b1d42b9ab4 100644 --- a/common/version.c +++ b/common/version.c @@ -1,18 +1,18 @@ /* * This file is part of mpv. * - * mpv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * * mpv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with mpv. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ #include "common.h" |