diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c37e9d..03709c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -792,7 +792,7 @@ add_executable( src/m3u8.c src/m3u8utils.c src/fstream.c - src/readlines.c + src/strsplit.c src/terminal.c src/ffmpeg_muxer.c src/ffmpegc_muxer.c diff --git a/src/fstream.c b/src/fstream.c index 6cf5f1a..7edd89e 100644 --- a/src/fstream.c +++ b/src/fstream.c @@ -26,7 +26,6 @@ On Linux: available when defined(_LARGEFILE64_SOURCE) or _POSIX_C_SOURCE >= 2001 On Apple, Android, Haiku and SerenityOS: available by default On FreeBSD and DragonFly BSD: available when __POSIX_VISIBLE >= 200112 or __XSI_VISIBLE >= 500 On NetBSD: available when __POSIX_VISIBLE >= 200112 or __XSI_VISIBLE >= 500 or defined(_NETBSD_SOURCE) -*/ #if ((defined(__linux__) && (defined(_LARGEFILE64_SOURCE) || defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)) || defined(__HAIKU__) || defined(__serenity__) || \ ((defined(__FreeBSD__) || defined(__DragonFly__)) && (__POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500)) || \ @@ -35,6 +34,10 @@ On NetBSD: available when __POSIX_VISIBLE >= 200112 or __XSI_VISIBLE >= 500 or d #define HAVE_FSEEKO 1 #define HAVE_FTELLO 1 #endif +*/ + +#define HAVE_FSEEKO 1 +#define HAVE_FTELLO 1 struct FStream* fstream_open(const char* const filename, const enum FStreamMode mode) { /* diff --git a/src/m3u8.c b/src/m3u8.c index 6b2aa82..caf3a21 100644 --- a/src/m3u8.c +++ b/src/m3u8.c @@ -42,32 +42,34 @@ static const enum M3U8VItemType M3U8_VITEM_TYPES[] = { #define M3U8TAG_SETVAL_ITEMS 3 /* -The M3U8 specification does not specify a maximum limit for line lengths, -but a hard limit of 10240 (10 KiB) is set here. +Max limit for line lengths. */ -#define M3U8_MAX_LINE_LEN (1024 * 10) +#define M3U8_MAX_LINE_LEN (1024 * 10) /* 10 KiB */ /* -The M3U8 specification does not specify a maximum limit for attribute values, -but a hard limit of 5120 (5 KiB) is set here. +Max length limit for attribute values. */ -#define M3U8_MAX_ATTR_VALUE_LEN (1024 * 5) +#define M3U8_MAX_ATTR_VALUE_LEN (1024 * 5) /* 5 KiB */ /* -The M3U8 specification does not specify a maximum limit for attribute names, -but a hard limit of 50 is set here. +Max length limit for attribute names. */ -#define M3U8_MAX_ATTR_NAME_LEN (50 * 1) +#define M3U8_MAX_ATTR_NAME_LEN (50 * 1) /* 50 */ /* -The longest M3U8 tag name is 'EXT-X-DISCONTINUITY-SEQUENCE', which contains -28 characters. +Max length limit for tag names. */ -#define M3U8_MAX_TAG_NAME_LEN (28 + 1) +#define M3U8_MAX_TAG_NAME_LEN (28 + 1) /* 28 */ +/* +Max length limit for item values. +*/ #define M3U8_MAX_ITEM_VALUE_LEN (128 * 5) -#define M3U8_MAX_PLAYLIST_LEN ((1024 * 1024 * 16) + 1) +/* +Maximum length limit for M3U8 playlists. +*/ +#define M3U8_MAX_PLAYLIST_LEN ((1024 * 1024 * 16) + 1) /* 16 MiB */ #define M3U8_PLAYLIST_TAG 1 #define M3U8_PLAYLIST_COMMENT 2 @@ -167,7 +169,6 @@ static const char M3U8K_LAST_PART[] = "LAST-PART"; static const char M3U8K_STABLE_RENDITION_ID[] = "STABLE-RENDITION-ID"; static const char M3U8K_BIT_DEPTH[] = "BIT-DEPTH"; static const char M3U8K_SAMPLE_RATE[] = "SAMPLE-RATE"; - static const char M3U8K_SCORE[] = "SCORE"; static const char M3U8K_SUPPLEMENTAL_CODECS[] = "SUPPLEMENTAL-CODECS"; static const char M3U8K_ALLOWED_CPC[] = "ALLOWED-CPC";