summaryrefslogtreecommitdiff
path: root/pkg/mpv
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-01-01 05:21:38 -0800
committerMichael Forney <mforney@mforney.org>2017-01-01 05:21:38 -0800
commitb83a0e6ee315dcd3dc492e37fdd8e44726bee1b3 (patch)
tree3102e8a5d65243a74e4b36037a898577e949f34d /pkg/mpv
parentce7fb58bcf6ef955d57d1e3ab06ce4a1480c2b35 (diff)
mpv: Update to 0.23.0
Diffstat (limited to 'pkg/mpv')
-rw-r--r--pkg/mpv/config.h14
-rw-r--r--pkg/mpv/patch/0002-Add-generated-ebml-sources.patch1471
-rw-r--r--pkg/mpv/patch/0003-Add-generated-man-page.patch307
-rw-r--r--pkg/mpv/patch/0004-ad_spdif-Fix-crash-when-spdif-muxer-is-not-available.patch28
-rw-r--r--pkg/mpv/rev2
-rw-r--r--pkg/mpv/sources.txt2
m---------pkg/mpv/src0
7 files changed, 865 insertions, 959 deletions
diff --git a/pkg/mpv/config.h b/pkg/mpv/config.h
index 0399c7a0..41ed4aac 100644
--- a/pkg/mpv/config.h
+++ b/pkg/mpv/config.h
@@ -24,7 +24,6 @@
#define HAVE_LIBM 1
#define HAVE_MINGW 0
#define HAVE_POSIX 1
-#define HAVE_FNMATCH 1
#define HAVE_POSIX_OR_MINGW 1
#define HAVE_WIN32 0
#define HAVE_WIN32_INTERNAL_PTHREADS 0
@@ -68,8 +67,6 @@
#define HAVE_DVDREAD 0
#define HAVE_DVDNAV 0
#define HAVE_CDDA 0
-#define HAVE_ENCA 0
-#define HAVE_LIBGUESS 0
#define HAVE_UCHARDET 0
#define HAVE_RUBBERBAND 0
#define HAVE_LCMS2 0
@@ -111,6 +108,7 @@
#define HAVE_GL_WIN32 0
#define HAVE_GL_DXINTEROP 0
#define HAVE_EGL_ANGLE 0
+#define HAVE_EGL_ANGLE_LIB 0
#define HAVE_VDPAU 0
#define HAVE_VDPAU_GL_X11 0
#define HAVE_VAAPI 0
@@ -142,16 +140,6 @@
#define HAVE_AVCODEC_CHROMA_POS_API 1
#define HAVE_AVFRAME_METADATA 1
#define HAVE_AVFRAME_SKIP_SAMPLES 1
-#define HAVE_AV_PIX_FMT_MMAL 1
-#define HAVE_AV_VERSION_INFO 1
-#define HAVE_AV_NEW_PIXDESC 1
-#define HAVE_AV_AVPACKET_INT64_DURATION 1
-#define HAVE_AV_SUBTITLE_NOPICT 1
-#define HAVE_AVCODEC_PROFILE_NAME 1
-#define HAVE_AVCODEC_NEW_CODEC_API 1
-#define HAVE_AVCODEC_HAS_CODECPAR 1
-#define HAVE_AVUTIL_HAS_HWCONTEXT 1
-#define HAVE_AVUTIL_HDR 1
#define HAVE_AVUTIL_MASTERING_METADATA 1
#define HAVE_VAAPI_HWACCEL 0
#define HAVE_VIDEOTOOLBOX_VIDEOTOOLBOX_H 0
diff --git a/pkg/mpv/patch/0002-Add-generated-ebml-sources.patch b/pkg/mpv/patch/0002-Add-generated-ebml-sources.patch
index bb3be12e..06a6fa19 100644
--- a/pkg/mpv/patch/0002-Add-generated-ebml-sources.patch
+++ b/pkg/mpv/patch/0002-Add-generated-ebml-sources.patch
@@ -1,363 +1,425 @@
-From 79a9af59e6865a39214f628186fd768165fa2329 Mon Sep 17 00:00:00 2001
+From ed365ad8132ef1c52de6a69e85e19e8404cea925 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 2 Jul 2016 17:32:27 -0700
Subject: [PATCH] Add generated ebml sources
-These require perl to generate.
+These require python to generate.
-$ perl TOOLS/matroska.pl --generate-header demux/ebml.c demux/demux_mkv.c > demux/ebml_types.h
-$ perl TOOLS/matroska.pl --generate-definitions demux/ebml.c > demux/ebml_defs.c
+$ python TOOLS/matroska.py --generate-header demux/ebml.c demux/demux_mkv.c > demux/ebml_types.h
+$ python TOOLS/matroska.py --generate-definitions demux/ebml.c > demux/ebml_defs.c
---
demux/ebml_defs.c | 529 +++++++++++++++++++++++++++++++++++++++++++++++
- demux/ebml_types.h | 587 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 1116 insertions(+)
+ demux/ebml_types.h | 586 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 1115 insertions(+)
create mode 100644 demux/ebml_defs.c
create mode 100644 demux/ebml_types.h
diff --git a/demux/ebml_defs.c b/demux/ebml_defs.c
new file mode 100644
-index 000000000..3fcbf8a5b
+index 000000000..e4e205094
--- /dev/null
+++ b/demux/ebml_defs.c
@@ -0,0 +1,529 @@
-+/* Generated by TOOLS/matroska.pl, do not edit manually */
++// Generated by TOOLS/matroska.py, do not edit manually
+
+
-+E("EBMLVersion", ebml_version, EBML_TYPE_UINT)
-+
-+E("EBMLReadVersion", ebml_read_version, EBML_TYPE_UINT)
-+
-+E("EBMLMaxIDLength", ebml_max_id_length, EBML_TYPE_UINT)
-+
-+E("EBMLMaxSizeLength", ebml_max_size_length, EBML_TYPE_UINT)
-+
-+E("DocType", doc_type, EBML_TYPE_STR)
++E("TagString", tag_string, EBML_TYPE_STR)
+
-+E("DocTypeVersion", doc_type_version, EBML_TYPE_UINT)
++E("TagLanguage", tag_language, EBML_TYPE_STR)
+
-+E("DocTypeReadVersion", doc_type_read_version, EBML_TYPE_UINT)
++E("TagName", tag_name, EBML_TYPE_STR)
+
-+#define N ebml
-+E_S("EBML", 7)
-+F(EBML_ID_DOCTYPE, doc_type, 0)
-+F(EBML_ID_DOCTYPEREADVERSION, doc_type_read_version, 0)
-+F(EBML_ID_DOCTYPEVERSION, doc_type_version, 0)
-+F(EBML_ID_EBMLMAXIDLENGTH, ebml_max_id_length, 0)
-+F(EBML_ID_EBMLMAXSIZELENGTH, ebml_max_size_length, 0)
-+F(EBML_ID_EBMLREADVERSION, ebml_read_version, 0)
-+F(EBML_ID_EBMLVERSION, ebml_version, 0)
++#define N simple_tag
++E_S("SimpleTag", 3)
++F(MATROSKA_ID_TAGNAME, tag_name, 0)
++F(MATROSKA_ID_TAGLANGUAGE, tag_language, 0)
++F(MATROSKA_ID_TAGSTRING, tag_string, 0)
+}};
+#undef N
+
-+E("CRC32", crc32, EBML_TYPE_BINARY)
++E("TargetAttachmentUID", target_attachment_uid, EBML_TYPE_UINT)
+
-+E("Void", void, EBML_TYPE_BINARY)
++E("TargetChapterUID", target_chapter_uid, EBML_TYPE_UINT)
+
-+E("SeekID", seek_id, EBML_TYPE_EBML_ID)
++E("TargetEditionUID", target_edition_uid, EBML_TYPE_UINT)
+
-+E("SeekPosition", seek_position, EBML_TYPE_UINT)
++E("TargetTrackUID", target_track_uid, EBML_TYPE_UINT)
+
-+#define N seek
-+E_S("Seek", 2)
-+F(MATROSKA_ID_SEEKID, seek_id, 0)
-+F(MATROSKA_ID_SEEKPOSITION, seek_position, 0)
++E("TargetTypeValue", target_type_value, EBML_TYPE_UINT)
++
++#define N targets
++E_S("Targets", 5)
++F(MATROSKA_ID_TARGETTYPEVALUE, target_type_value, 0)
++F(MATROSKA_ID_TARGETTRACKUID, target_track_uid, 0)
++F(MATROSKA_ID_TARGETEDITIONUID, target_edition_uid, 0)
++F(MATROSKA_ID_TARGETCHAPTERUID, target_chapter_uid, 0)
++F(MATROSKA_ID_TARGETATTACHMENTUID, target_attachment_uid, 0)
+}};
+#undef N
+
-+#define N seek_head
-+E_S("SeekHead", 1)
-+F(MATROSKA_ID_SEEK, seek, 1)
++#define N tag
++E_S("Tag", 2)
++F(MATROSKA_ID_TARGETS, targets, 0)
++F(MATROSKA_ID_SIMPLETAG, simple_tag, 1)
+}};
+#undef N
+
-+E("SegmentUID", segment_uid, EBML_TYPE_BINARY)
++#define N tags
++E_S("Tags", 1)
++F(MATROSKA_ID_TAG, tag, 1)
++}};
++#undef N
+
-+E("PrevUID", prev_uid, EBML_TYPE_BINARY)
++E("ChapCountry", chap_country, EBML_TYPE_STR)
+
-+E("NextUID", next_uid, EBML_TYPE_BINARY)
++E("ChapLanguage", chap_language, EBML_TYPE_STR)
+
-+E("TimecodeScale", timecode_scale, EBML_TYPE_UINT)
++E("ChapString", chap_string, EBML_TYPE_STR)
+
-+E("DateUTC", date_utc, EBML_TYPE_SINT)
++#define N chapter_display
++E_S("ChapterDisplay", 3)
++F(MATROSKA_ID_CHAPSTRING, chap_string, 0)
++F(MATROSKA_ID_CHAPLANGUAGE, chap_language, 1)
++F(MATROSKA_ID_CHAPCOUNTRY, chap_country, 1)
++}};
++#undef N
+
-+E("Title", title, EBML_TYPE_STR)
++E("ChapterSegmentEditionUID", chapter_segment_edition_uid, EBML_TYPE_UINT)
+
-+E("MuxingApp", muxing_app, EBML_TYPE_STR)
++E("ChapterSegmentUID", chapter_segment_uid, EBML_TYPE_BINARY)
+
-+E("WritingApp", writing_app, EBML_TYPE_STR)
++E("ChapterFlagEnabled", chapter_flag_enabled, EBML_TYPE_UINT)
+
-+E("Duration", duration, EBML_TYPE_FLOAT)
++E("ChapterFlagHidden", chapter_flag_hidden, EBML_TYPE_UINT)
+
-+#define N info
-+E_S("Info", 9)
-+F(MATROSKA_ID_DATEUTC, date_utc, 0)
-+F(MATROSKA_ID_DURATION, duration, 0)
-+F(MATROSKA_ID_MUXINGAPP, muxing_app, 0)
-+F(MATROSKA_ID_NEXTUID, next_uid, 0)
-+F(MATROSKA_ID_PREVUID, prev_uid, 0)
-+F(MATROSKA_ID_SEGMENTUID, segment_uid, 0)
-+F(MATROSKA_ID_TIMECODESCALE, timecode_scale, 0)
-+F(MATROSKA_ID_TITLE, title, 0)
-+F(MATROSKA_ID_WRITINGAPP, writing_app, 0)
++E("ChapterTimeEnd", chapter_time_end, EBML_TYPE_UINT)
++
++E("ChapterTimeStart", chapter_time_start, EBML_TYPE_UINT)
++
++E("ChapterUID", chapter_uid, EBML_TYPE_UINT)
++
++#define N chapter_atom
++E_S("ChapterAtom", 8)
++F(MATROSKA_ID_CHAPTERUID, chapter_uid, 0)
++F(MATROSKA_ID_CHAPTERTIMESTART, chapter_time_start, 0)
++F(MATROSKA_ID_CHAPTERTIMEEND, chapter_time_end, 0)
++F(MATROSKA_ID_CHAPTERFLAGHIDDEN, chapter_flag_hidden, 0)
++F(MATROSKA_ID_CHAPTERFLAGENABLED, chapter_flag_enabled, 0)
++F(MATROSKA_ID_CHAPTERSEGMENTUID, chapter_segment_uid, 0)
++F(MATROSKA_ID_CHAPTERSEGMENTEDITIONUID, chapter_segment_edition_uid, 0)
++F(MATROSKA_ID_CHAPTERDISPLAY, chapter_display, 1)
+}};
+#undef N
+
-+E("Timecode", timecode, EBML_TYPE_UINT)
-+
-+E("Block", block, EBML_TYPE_BINARY)
++E("EditionFlagOrdered", edition_flag_ordered, EBML_TYPE_UINT)
+
-+E("BlockDuration", block_duration, EBML_TYPE_UINT)
++E("EditionFlagDefault", edition_flag_default, EBML_TYPE_UINT)
+
-+E("ReferenceBlock", reference_block, EBML_TYPE_SINT)
++E("EditionFlagHidden", edition_flag_hidden, EBML_TYPE_UINT)
+
-+E("DiscardPadding", discard_padding, EBML_TYPE_SINT)
++E("EditionUID", edition_uid, EBML_TYPE_UINT)
+
-+#define N block_group
-+E_S("BlockGroup", 4)
-+F(MATROSKA_ID_BLOCK, block, 0)
-+F(MATROSKA_ID_BLOCKDURATION, block_duration, 0)
-+F(MATROSKA_ID_DISCARDPADDING, discard_padding, 0)
-+F(MATROSKA_ID_REFERENCEBLOCK, reference_block, 1)
++#define N edition_entry
++E_S("EditionEntry", 5)
++F(MATROSKA_ID_EDITIONUID, edition_uid, 0)
++F(MATROSKA_ID_EDITIONFLAGHIDDEN, edition_flag_hidden, 0)
++F(MATROSKA_ID_EDITIONFLAGDEFAULT, edition_flag_default, 0)
++F(MATROSKA_ID_EDITIONFLAGORDERED, edition_flag_ordered, 0)
++F(MATROSKA_ID_CHAPTERATOM, chapter_atom, 1)
+}};
+#undef N
+
-+E("SimpleBlock", simple_block, EBML_TYPE_BINARY)
-+
-+#define N cluster
-+E_S("Cluster", 3)
-+F(MATROSKA_ID_BLOCKGROUP, block_group, 1)
-+F(MATROSKA_ID_SIMPLEBLOCK, simple_block, 1)
-+F(MATROSKA_ID_TIMECODE, timecode, 0)
++#define N chapters
++E_S("Chapters", 1)
++F(MATROSKA_ID_EDITIONENTRY, edition_entry, 1)
+}};
+#undef N
+
-+E("TrackNumber", track_number, EBML_TYPE_UINT)
++E("FileUID", file_uid, EBML_TYPE_UINT)
+
-+E("TrackUID", track_uid, EBML_TYPE_UINT)
++E("FileData", file_data, EBML_TYPE_BINARY)
+
-+E("TrackType", track_type, EBML_TYPE_UINT)
++E("FileMimeType", file_mime_type, EBML_TYPE_STR)
+
-+E("FlagEnabled", flag_enabled, EBML_TYPE_UINT)
++E("FileName", file_name, EBML_TYPE_STR)
+
-+E("FlagDefault", flag_default, EBML_TYPE_UINT)
++E("FileDescription", file_description, EBML_TYPE_STR)
+
-+E("FlagForced", flag_forced, EBML_TYPE_UINT)
++#define N attached_file
++E_S("AttachedFile", 5)
++F(MATROSKA_ID_FILEDESCRIPTION, file_description, 0)
++F(MATROSKA_ID_FILENAME, file_name, 0)
++F(MATROSKA_ID_FILEMIMETYPE, file_mime_type, 0)
++F(MATROSKA_ID_FILEDATA, file_data, 0)
++F(MATROSKA_ID_FILEUID, file_uid, 0)
++}};
++#undef N
+
-+E("FlagLacing", flag_lacing, EBML_TYPE_UINT)
++#define N attachments
++E_S("Attachments", 1)
++F(MATROSKA_ID_ATTACHEDFILE, attached_file, 1)
++}};
++#undef N
+
-+E("MinCache", min_cache, EBML_TYPE_UINT)
++E("CueDuration", cue_duration, EBML_TYPE_UINT)
+
-+E("MaxCache", max_cache, EBML_TYPE_UINT)
++E("CueRelativePosition", cue_relative_position, EBML_TYPE_UINT)
+
-+E("DefaultDuration", default_duration, EBML_TYPE_UINT)
++E("CueClusterPosition", cue_cluster_position, EBML_TYPE_UINT)
+
-+E("TrackTimecodeScale", track_timecode_scale, EBML_TYPE_FLOAT)
++E("CueTrack", cue_track, EBML_TYPE_UINT)
+
-+E("MaxBlockAdditionID", max_block_addition_id, EBML_TYPE_UINT)
++#define N cue_track_positions
++E_S("CueTrackPositions", 4)
++F(MATROSKA_ID_CUETRACK, cue_track, 0)
++F(MATROSKA_ID_CUECLUSTERPOSITION, cue_cluster_position, 0)
++F(MATROSKA_ID_CUERELATIVEPOSITION, cue_relative_position, 0)
++F(MATROSKA_ID_CUEDURATION, cue_duration, 0)
++}};
++#undef N
+
-+E("Name", name, EBML_TYPE_STR)
++E("CueTime", cue_time, EBML_TYPE_UINT)
+
-+E("Language", language, EBML_TYPE_STR)
++#define N cue_point
++E_S("CuePoint", 2)
++F(MATROSKA_ID_CUETIME, cue_time, 0)
++F(MATROSKA_ID_CUETRACKPOSITIONS, cue_track_positions, 1)
++}};
++#undef N
+
-+E("CodecID", codec_id, EBML_TYPE_STR)
++#define N cues
++E_S("Cues", 1)
++F(MATROSKA_ID_CUEPOINT, cue_point, 1)
++}};
++#undef N
+
-+E("CodecPrivate", codec_private, EBML_TYPE_BINARY)
++E("ContentCompSettings", content_comp_settings, EBML_TYPE_BINARY)
+
-+E("CodecName", codec_name, EBML_TYPE_STR)
++E("ContentCompAlgo", content_comp_algo, EBML_TYPE_UINT)
+
-+E("CodecDecodeAll", codec_decode_all, EBML_TYPE_UINT)
++#define N content_compression
++E_S("ContentCompression", 2)
++F(MATROSKA_ID_CONTENTCOMPALGO, content_comp_algo, 0)
++F(MATROSKA_ID_CONTENTCOMPSETTINGS, content_comp_settings, 0)
++}};
++#undef N
+
-+E("CodecDelay", codec_delay, EBML_TYPE_UINT)
++E("ContentEncodingType", content_encoding_type, EBML_TYPE_UINT)
+
-+E("SeekPreRoll", seek_pre_roll, EBML_TYPE_UINT)
++E("ContentEncodingScope", content_encoding_scope, EBML_TYPE_UINT)
+
-+E("FlagInterlaced", flag_interlaced, EBML_TYPE_UINT)
++E("ContentEncodingOrder", content_encoding_order, EBML_TYPE_UINT)
+
-+E("PixelWidth", pixel_width, EBML_TYPE_UINT)
++#define N content_encoding
++E_S("ContentEncoding", 4)
++F(MATROSKA_ID_CONTENTENCODINGORDER, content_encoding_order, 0)
++F(MATROSKA_ID_CONTENTENCODINGSCOPE, content_encoding_scope, 0)
++F(MATROSKA_ID_CONTENTENCODINGTYPE, content_encoding_type, 0)
++F(MATROSKA_ID_CONTENTCOMPRESSION, content_compression, 0)
++}};
++#undef N
+
-+E("PixelHeight", pixel_height, EBML_TYPE_UINT)
++#define N content_encodings
++E_S("ContentEncodings", 1)
++F(MATROSKA_ID_CONTENTENCODING, content_encoding, 1)
++}};
++#undef N
+
-+E("DisplayWidth", display_width, EBML_TYPE_UINT)
++E("BitDepth", bit_depth, EBML_TYPE_UINT)
+
-+E("DisplayHeight", display_height, EBML_TYPE_UINT)
++E("Channels", channels, EBML_TYPE_UINT)
+
-+E("DisplayUnit", display_unit, EBML_TYPE_UINT)
++E("OutputSamplingFrequency", output_sampling_frequency, EBML_TYPE_FLOAT)
+
-+E("FrameRate", frame_rate, EBML_TYPE_FLOAT)
++E("SamplingFrequency", sampling_frequency, EBML_TYPE_FLOAT)
+
-+E("ColourSpace", colour_space, EBML_TYPE_BINARY)
++#define N audio
++E_S("Audio", 4)
++F(MATROSKA_ID_SAMPLINGFREQUENCY, sampling_frequency, 0)
++F(MATROSKA_ID_OUTPUTSAMPLINGFREQUENCY, output_sampling_frequency, 0)
++F(MATROSKA_ID_CHANNELS, channels, 0)
++F(MATROSKA_ID_BITDEPTH, bit_depth, 0)
++}};
++#undef N
+
-+E("StereoMode", stereo_mode, EBML_TYPE_UINT)
++E("LuminanceMin", luminance_min, EBML_TYPE_FLOAT)
+
-+E("MatrixCoefficients", matrix_coefficients, EBML_TYPE_UINT)
++E("LuminanceMax", luminance_max, EBML_TYPE_FLOAT)
+
-+E("BitsPerChannel", bits_per_channel, EBML_TYPE_UINT)
++E("WhitePointChromaticityY", white_point_chromaticity_y, EBML_TYPE_FLOAT)
+
-+E("ChromaSubsamplingHorz", chroma_subsampling_horz, EBML_TYPE_UINT)
++E("WhitePointChromaticityX", white_point_chromaticity_x, EBML_TYPE_FLOAT)
+
-+E("ChromaSubsamplingVert", chroma_subsampling_vert, EBML_TYPE_UINT)
++E("PrimaryBChromaticityY", primary_b_chromaticity_y, EBML_TYPE_FLOAT)
+
-+E("CbSubsamplingHorz", cb_subsampling_horz, EBML_TYPE_UINT)
++E("PrimaryBChromaticityX", primary_b_chromaticity_x, EBML_TYPE_FLOAT)
+
-+E("CbSubsamplingVert", cb_subsampling_vert, EBML_TYPE_UINT)
++E("PrimaryGChromaticityY", primary_g_chromaticity_y, EBML_TYPE_FLOAT)
+
-+E("ChromaSitingHorz", chroma_siting_horz, EBML_TYPE_UINT)
++E("PrimaryGChromaticityX", primary_g_chromaticity_x, EBML_TYPE_FLOAT)
+
-+E("ChromaSitingVert", chroma_siting_vert, EBML_TYPE_UINT)
++E("PrimaryRChromaticityY", primary_r_chromaticity_y, EBML_TYPE_FLOAT)
+
-+E("Range", range, EBML_TYPE_UINT)
++E("PrimaryRChromaticityX", primary_r_chromaticity_x, EBML_TYPE_FLOAT)
+
-+E("TransferCharacteristics", transfer_characteristics, EBML_TYPE_UINT)
++#define N mastering_metadata
++E_S("MasteringMetadata", 10)
++F(MATROSKA_ID_PRIMARYRCHROMATICITYX, primary_r_chromaticity_x, 0)
++F(MATROSKA_ID_PRIMARYRCHROMATICITYY, primary_r_chromaticity_y, 0)
++F(MATROSKA_ID_PRIMARYGCHROMATICITYX, primary_g_chromaticity_x, 0)
++F(MATROSKA_ID_PRIMARYGCHROMATICITYY, primary_g_chromaticity_y, 0)
++F(MATROSKA_ID_PRIMARYBCHROMATICITYX, primary_b_chromaticity_x, 0)
++F(MATROSKA_ID_PRIMARYBCHROMATICITYY, primary_b_chromaticity_y, 0)
++F(MATROSKA_ID_WHITEPOINTCHROMATICITYX, white_point_chromaticity_x, 0)
++F(MATROSKA_ID_WHITEPOINTCHROMATICITYY, white_point_chromaticity_y, 0)
++F(MATROSKA_ID_LUMINANCEMAX, luminance_max, 0)
++F(MATROSKA_ID_LUMINANCEMIN, luminance_min, 0)
++}};
++#undef N
+
-+E("Primaries", primaries, EBML_TYPE_UINT)
++E("MaxFALL", max_fall, EBML_TYPE_UINT)
+
+E("MaxCLL", max_cll, EBML_TYPE_UINT)
+
-+E("MaxFALL", max_fall, EBML_TYPE_UINT)
-+
-+E("PrimaryRChromaticityX", primary_r_chromaticity_x, EBML_TYPE_FLOAT)
++E("Primaries", primaries, EBML_TYPE_UINT)
+
-+E("PrimaryRChromaticityY", primary_r_chromaticity_y, EBML_TYPE_FLOAT)
++E("TransferCharacteristics", transfer_characteristics, EBML_TYPE_UINT)
+
-+E("PrimaryGChromaticityX", primary_g_chromaticity_x, EBML_TYPE_FLOAT)
++E("Range", range, EBML_TYPE_UINT)
+
-+E("PrimaryGChromaticityY", primary_g_chromaticity_y, EBML_TYPE_FLOAT)
++E("ChromaSitingVert", chroma_siting_vert, EBML_TYPE_UINT)
+
-+E("PrimaryBChromaticityX", primary_b_chromaticity_x, EBML_TYPE_FLOAT)
++E("ChromaSitingHorz", chroma_siting_horz, EBML_TYPE_UINT)
+
-+E("PrimaryBChromaticityY", primary_b_chromaticity_y, EBML_TYPE_FLOAT)
++E("CbSubsamplingVert", cb_subsampling_vert, EBML_TYPE_UINT)
+
-+E("WhitePointChromaticityX", white_point_chromaticity_x, EBML_TYPE_FLOAT)
++E("CbSubsamplingHorz", cb_subsampling_horz, EBML_TYPE_UINT)
+
-+E("WhitePointChromaticityY", white_point_chromaticity_y, EBML_TYPE_FLOAT)
++E("ChromaSubsamplingVert", chroma_subsampling_vert, EBML_TYPE_UINT)
+
-+E("LuminanceMax", luminance_max, EBML_TYPE_FLOAT)
++E("ChromaSubsamplingHorz", chroma_subsampling_horz, EBML_TYPE_UINT)
+
-+E("LuminanceMin", luminance_min, EBML_TYPE_FLOAT)
++E("BitsPerChannel", bits_per_channel, EBML_TYPE_UINT)
+
-+#define N mastering_metadata
-+E_S("MasteringMetadata", 10)
-+F(MATROSKA_ID_LUMINANCEMAX, luminance_max, 0)
-+F(MATROSKA_ID_LUMINANCEMIN, luminance_min, 0)
-+F(MATROSKA_ID_PRIMARYBCHROMATICITYX, primary_b_chromaticity_x, 0)
-+F(MATROSKA_ID_PRIMARYBCHROMATICITYY, primary_b_chromaticity_y, 0)
-+F(MATROSKA_ID_PRIMARYGCHROMATICITYX, primary_g_chromaticity_x, 0)
-+F(MATROSKA_ID_PRIMARYGCHROMATICITYY, primary_g_chromaticity_y, 0)
-+F(MATROSKA_ID_PRIMARYRCHROMATICITYX, primary_r_chromaticity_x, 0)
-+F(MATROSKA_ID_PRIMARYRCHROMATICITYY, primary_r_chromaticity_y, 0)
-+F(MATROSKA_ID_WHITEPOINTCHROMATICITYX, white_point_chromaticity_x, 0)
-+F(MATROSKA_ID_WHITEPOINTCHROMATICITYY, white_point_chromaticity_y, 0)
-+}};
-+#undef N
++E("MatrixCoefficients", matrix_coefficients, EBML_TYPE_UINT)
+
+#define N colour
+E_S("Colour", 14)
++F(MATROSKA_ID_MATRIXCOEFFICIENTS, matrix_coefficients, 0)
+F(MATROSKA_ID_BITSPERCHANNEL, bits_per_channel, 0)
++F(MATROSKA_ID_CHROMASUBSAMPLINGHORZ, chroma_subsampling_horz, 0)
++F(MATROSKA_ID_CHROMASUBSAMPLINGVERT, chroma_subsampling_vert, 0)
+F(MATROSKA_ID_CBSUBSAMPLINGHORZ, cb_subsampling_horz, 0)
+F(MATROSKA_ID_CBSUBSAMPLINGVERT, cb_subsampling_vert, 0)
+F(MATROSKA_ID_CHROMASITINGHORZ, chroma_siting_horz, 0)
+F(MATROSKA_ID_CHROMASITINGVERT, chroma_siting_vert, 0)
-+F(MATROSKA_ID_CHROMASUBSAMPLINGHORZ, chroma_subsampling_horz, 0)
-+F(MATROSKA_ID_CHROMASUBSAMPLINGVERT, chroma_subsampling_vert, 0)
-+F(MATROSKA_ID_MASTERINGMETADATA, mastering_metadata, 0)
-+F(MATROSKA_ID_MATRIXCOEFFICIENTS, matrix_coefficients, 0)
-+F(MATROSKA_ID_MAXCLL, max_cll, 0)
-+F(MATROSKA_ID_MAXFALL, max_fall, 0)
-+F(MATROSKA_ID_PRIMARIES, primaries, 0)
+F(MATROSKA_ID_RANGE, range, 0)
+F(MATROSKA_ID_TRANSFERCHARACTERISTICS, transfer_characteristics, 0)
++F(MATROSKA_ID_PRIMARIES, primaries, 0)
++F(MATROSKA_ID_MAXCLL, max_cll, 0)
++F(MATROSKA_ID_MAXFALL, max_fall, 0)
++F(MATROSKA_ID_MASTERINGMETADATA, mastering_metadata, 0)
+}};
+#undef N
+
++E("StereoMode", stereo_mode, EBML_TYPE_UINT)
++
++E("ColourSpace", colour_space, EBML_TYPE_BINARY)
++
++E("FrameRate", frame_rate, EBML_TYPE_FLOAT)
++
++E("DisplayUnit", display_unit, EBML_TYPE_UINT)
++
++E("DisplayHeight", display_height, EBML_TYPE_UINT)
++
++E("DisplayWidth", display_width, EBML_TYPE_UINT)
++
++E("PixelHeight", pixel_height, EBML_TYPE_UINT)
++
++E("PixelWidth", pixel_width, EBML_TYPE_UINT)
++
++E("FlagInterlaced", flag_interlaced, EBML_TYPE_UINT)
++
+#define N video
+E_S("Video", 10)
-+F(MATROSKA_ID_COLOUR, colour, 0)
-+F(MATROSKA_ID_COLOURSPACE, colour_space, 0)
++F(MATROSKA_ID_FLAGINTERLACED, flag_interlaced, 0)
++F(MATROSKA_ID_PIXELWIDTH, pixel_width, 0)
++F(MATROSKA_ID_PIXELHEIGHT, pixel_height, 0)
++F(MATROSKA_ID_DISPLAYWIDTH, display_width, 0)
+F(MATROSKA_ID_DISPLAYHEIGHT, display_height, 0)
+F(MATROSKA_ID_DISPLAYUNIT, display_unit, 0)
-+F(MATROSKA_ID_DISPLAYWIDTH, display_width, 0)
-+F(MATROSKA_ID_FLAGINTERLACED, flag_interlaced, 0)
+F(MATROSKA_ID_FRAMERATE, frame_rate, 0)
-+F(MATROSKA_ID_PIXELHEIGHT, pixel_height, 0)
-+F(MATROSKA_ID_PIXELWIDTH, pixel_width, 0)
++F(MATROSKA_ID_COLOURSPACE, colour_space, 0)
+F(MATROSKA_ID_STEREOMODE, stereo_mode, 0)
++F(MATROSKA_ID_COLOUR, colour, 0)
+}};
+#undef N
+
-+E("SamplingFrequency", sampling_frequency, EBML_TYPE_FLOAT)
++E("SeekPreRoll", seek_pre_roll, EBML_TYPE_UINT)
+
-+E("OutputSamplingFrequency", output_sampling_frequency, EBML_TYPE_FLOAT)
++E("CodecDelay", codec_delay, EBML_TYPE_UINT)
+
-+E("Channels", channels, EBML_TYPE_UINT)
++E("CodecDecodeAll", codec_decode_all, EBML_TYPE_UINT)
+
-+E("BitDepth", bit_depth, EBML_TYPE_UINT)
++E("CodecName", codec_name, EBML_TYPE_STR)
+
-+#define N audio
-+E_S("Audio", 4)
-+F(MATROSKA_ID_BITDEPTH, bit_depth, 0)
-+F(MATROSKA_ID_CHANNELS, channels, 0)
-+F(MATROSKA_ID_OUTPUTSAMPLINGFREQUENCY, output_sampling_frequency, 0)
-+F(MATROSKA_ID_SAMPLINGFREQUENCY, sampling_frequency, 0)
-+}};
-+#undef N
++E("CodecPrivate", codec_private, EBML_TYPE_BINARY)
+
-+E("ContentEncodingOrder", content_encoding_order, EBML_TYPE_UINT)
++E("CodecID", codec_id, EBML_TYPE_STR)
+
-+E("ContentEncodingScope", content_encoding_scope, EBML_TYPE_UINT)
++E("Language", language, EBML_TYPE_STR)
+
-+E("ContentEncodingType", content_encoding_type, EBML_TYPE_UINT)
++E("Name", name, EBML_TYPE_STR)
+
-+E("ContentCompAlgo", content_comp_algo, EBML_TYPE_UINT)
++E("MaxBlockAdditionID", max_block_addition_id, EBML_TYPE_UINT)
+
-+E("ContentCompSettings", content_comp_settings, EBML_TYPE_BINARY)
++E("TrackTimecodeScale", track_timecode_scale, EBML_TYPE_FLOAT)
+
-+#define N content_compression
-+E_S("ContentCompression", 2)
-+F(MATROSKA_ID_CONTENTCOMPALGO, content_comp_algo, 0)
-+F(MATROSKA_ID_CONTENTCOMPSETTINGS, content_comp_settings, 0)
-+}};
-+#undef N
++E("DefaultDuration", default_duration, EBML_TYPE_UINT)
+
-+#define N content_encoding
-+E_S("ContentEncoding", 4)
-+F(MATROSKA_ID_CONTENTCOMPRESSION, content_compression, 0)
-+F(MATROSKA_ID_CONTENTENCODINGORDER, content_encoding_order, 0)
-+F(MATROSKA_ID_CONTENTENCODINGSCOPE, content_encoding_scope, 0)
-+F(MATROSKA_ID_CONTENTENCODINGTYPE, content_encoding_type, 0)
-+}};
-+#undef N
++E("MaxCache", max_cache, EBML_TYPE_UINT)
+
-+#define N content_encodings
-+E_S("ContentEncodings", 1)
-+F(MATROSKA_ID_CONTENTENCODING, content_encoding, 1)
-+}};
-+#undef N
++E("MinCache", min_cache, EBML_TYPE_UINT)
++
++E("FlagLacing", flag_lacing, EBML_TYPE_UINT)
++
++E("FlagForced", flag_forced, EBML_TYPE_UINT)
++
++E("FlagDefault", flag_default, EBML_TYPE_UINT)
++
++E("FlagEnabled", flag_enabled, EBML_TYPE_UINT)
++
++E("TrackType", track_type, EBML_TYPE_UINT)
++
++E("TrackUID", track_uid, EBML_TYPE_UINT)
++
++E("TrackNumber", track_number, EBML_TYPE_UINT)
+
+#define N track_entry
+E_S("TrackEntry", 23)
-+F(MATROSKA_ID_AUDIO, audio, 0)
-+F(MATROSKA_ID_CODECDECODEALL, codec_decode_all, 0)
-+F(MATROSKA_ID_CODECDELAY, codec_delay, 0)
-+F(MATROSKA_ID_CODECID, codec_id, 0)
-+F(MATROSKA_ID_CODECNAME, codec_name, 0)
-+F(MATROSKA_ID_CODECPRIVATE, codec_private, 0)
-+F(MATROSKA_ID_CONTENTENCODINGS, content_encodings, 0)
-+F(MATROSKA_ID_DEFAULTDURATION, default_duration, 0)
-+F(MATROSKA_ID_FLAGDEFAULT, flag_default, 0)
++F(MATROSKA_ID_TRACKNUMBER, track_number, 0)
++F(MATROSKA_ID_TRACKUID, track_uid, 0)
++F(MATROSKA_ID_TRACKTYPE, track_type, 0)
+F(MATROSKA_ID_FLAGENABLED, flag_enabled, 0)
++F(MATROSKA_ID_FLAGDEFAULT, flag_default, 0)
+F(MATROSKA_ID_FLAGFORCED, flag_forced, 0)
+F(MATROSKA_ID_FLAGLACING, flag_lacing, 0)
-+F(MATROSKA_ID_LANGUAGE, language, 0)
-+F(MATROSKA_ID_MAXBLOCKADDITIONID, max_block_addition_id, 0)
-+F(MATROSKA_ID_MAXCACHE, max_cache, 0)
+F(MATROSKA_ID_MINCACHE, min_cache, 0)
++F(MATROSKA_ID_MAXCACHE, max_cache, 0)
++F(MATROSKA_ID_DEFAULTDURATION, default_duration, 0)
++F(MATROSKA_ID_TRACKTIMECODESCALE, track_timecode_scale, 0)
++F(MATROSKA_ID_MAXBLOCKADDITIONID, max_block_addition_id, 0)
+F(MATROSKA_ID_NAME, name, 0)
++F(MATROSKA_ID_LANGUAGE, language, 0)
++F(MATROSKA_ID_CODECID, codec_id, 0)
++F(MATROSKA_ID_CODECPRIVATE, codec_private, 0)
++F(MATROSKA_ID_CODECNAME, codec_name, 0)
++F(MATROSKA_ID_CODECDECODEALL, codec_decode_all, 0)
++F(MATROSKA_ID_CODECDELAY, codec_delay, 0)
+F(MATROSKA_ID_SEEKPREROLL, seek_pre_roll, 0)
-+F(MATROSKA_ID_TRACKNUMBER, track_number, 0)
-+F(MATROSKA_ID_TRACKTIMECODESCALE, track_timecode_scale, 0)
-+F(MATROSKA_ID_TRACKTYPE, track_type, 0)
-+F(MATROSKA_ID_TRACKUID, track_uid, 0)
+F(MATROSKA_ID_VIDEO, video, 0)
++F(MATROSKA_ID_AUDIO, audio, 0)
++F(MATROSKA_ID_CONTENTENCODINGS, content_encodings, 0)
+}};
+#undef N
+
@@ -367,196 +429,135 @@ index 000000000..3fcbf8a5b
+}};
+#undef N
+
-+E("CueTime", cue_time, EBML_TYPE_UINT)
-+
-+E("CueTrack", cue_track, EBML_TYPE_UINT)
-+
-+E("CueClusterPosition", cue_cluster_position, EBML_TYPE_UINT)
++E("SimpleBlock", simple_block, EBML_TYPE_BINARY)
+
-+E("CueRelativePosition", cue_relative_position, EBML_TYPE_UINT)
++E("DiscardPadding", discard_padding, EBML_TYPE_SINT)
+
-+E("CueDuration", cue_duration, EBML_TYPE_UINT)
++E("ReferenceBlock", reference_block, EBML_TYPE_SINT)
+
-+#define N cue_track_positions
-+E_S("CueTrackPositions", 4)
-+F(MATROSKA_ID_CUECLUSTERPOSITION, cue_cluster_position, 0)
-+F(MATROSKA_ID_CUEDURATION, cue_duration, 0)
-+F(MATROSKA_ID_CUERELATIVEPOSITION, cue_relative_position, 0)
-+F(MATROSKA_ID_CUETRACK, cue_track, 0)
-+}};
-+#undef N
++E("BlockDuration", block_duration, EBML_TYPE_UINT)
+
-+#define N cue_point
-+E_S("CuePoint", 2)
-+F(MATROSKA_ID_CUETIME, cue_time, 0)
-+F(MATROSKA_ID_CUETRACKPOSITIONS, cue_track_positions, 1)
-+}};
-+#undef N
++E("Block", block, EBML_TYPE_BINARY)
+
-+#define N cues
-+E_S("Cues", 1)
-+F(MATROSKA_ID_CUEPOINT, cue_point, 1)
++#define N block_group
++E_S("BlockGroup", 4)
++F(MATROSKA_ID_BLOCK, block, 0)
++F(MATROSKA_ID_BLOCKDURATION, block_duration, 0)
++F(MATROSKA_ID_REFERENCEBLOCK, reference_block, 1)
++F(MATROSKA_ID_DISCARDPADDING, discard_padding, 0)
+}};
+#undef N
+
-+E("FileDescription", file_description, EBML_TYPE_STR)
-+
-+E("FileName", file_name, EBML_TYPE_STR)
-+
-+E("FileMimeType", file_mime_type, EBML_TYPE_STR)
-+
-+E("FileData", file_data, EBML_TYPE_BINARY)
-+
-+E("FileUID", file_uid, EBML_TYPE_UINT)
-+
-+#define N attached_file
-+E_S("AttachedFile", 5)
-+F(MATROSKA_ID_FILEDATA, file_data, 0)
-+F(MATROSKA_ID_FILEDESCRIPTION, file_description, 0)
-+F(MATROSKA_ID_FILEMIMETYPE, file_mime_type, 0)
-+F(MATROSKA_ID_FILENAME, file_name, 0)
-+F(MATROSKA_ID_FILEUID, file_uid, 0)
-+}};
-+#undef N
++E("Timecode", timecode, EBML_TYPE_UINT)
+
-+#define N attachments
-+E_S("Attachments", 1)
-+F(MATROSKA_ID_ATTACHEDFILE, attached_file, 1)
++#define N cluster
++E_S("Cluster", 3)
++F(MATROSKA_ID_TIMECODE, timecode, 0)
++F(MATROSKA_ID_BLOCKGROUP, block_group, 1)
++F(MATROSKA_ID_SIMPLEBLOCK, simple_block, 1)
+}};
+#undef N
+
-+E("EditionUID", edition_uid, EBML_TYPE_UINT)
-+
-+E("EditionFlagHidden", edition_flag_hidden, EBML_TYPE_UINT)
-+
-+E("EditionFlagDefault", edition_flag_default, EBML_TYPE_UINT)
-+
-+E("EditionFlagOrdered", edition_flag_ordered, EBML_TYPE_UINT)
-+
-+E("ChapterUID", chapter_uid, EBML_TYPE_UINT)
-+
-+E("ChapterTimeStart", chapter_time_start, EBML_TYPE_UINT)
++E("Duration", duration, EBML_TYPE_FLOAT)
+
-+E("ChapterTimeEnd", chapter_time_end, EBML_TYPE_UINT)
++E("WritingApp", writing_app, EBML_TYPE_STR)
+
-+E("ChapterFlagHidden", chapter_flag_hidden, EBML_TYPE_UINT)
++E("MuxingApp", muxing_app, EBML_TYPE_STR)
+
-+E("ChapterFlagEnabled", chapter_flag_enabled, EBML_TYPE_UINT)
++E("Title", title, EBML_TYPE_STR)
+
-+E("ChapterSegmentUID", chapter_segment_uid, EBML_TYPE_BINARY)
++E("DateUTC", date_utc, EBML_TYPE_SINT)
+
-+E("ChapterSegmentEditionUID", chapter_segment_edition_uid, EBML_TYPE_UINT)
++E("TimecodeScale", timecode_scale, EBML_TYPE_UINT)
+
-+E("ChapString", chap_string, EBML_TYPE_STR)
++E("NextUID", next_uid, EBML_TYPE_BINARY)
+
-+E("ChapLanguage", chap_language, EBML_TYPE_STR)
++E("PrevUID", prev_uid, EBML_TYPE_BINARY)
+
-+E("ChapCountry", chap_country, EBML_TYPE_STR)
++E("SegmentUID", segment_uid, EBML_TYPE_BINARY)
+
-+#define N chapter_display
-+E_S("ChapterDisplay", 3)
-+F(MATROSKA_ID_CHAPCOUNTRY, chap_country, 1)
-+F(MATROSKA_ID_CHAPLANGUAGE, chap_language, 1)
-+F(MATROSKA_ID_CHAPSTRING, chap_string, 0)
++#define N info
++E_S("Info", 9)
++F(MATROSKA_ID_SEGMENTUID, segment_uid, 0)
++F(MATROSKA_ID_PREVUID, prev_uid, 0)
++F(MATROSKA_ID_NEXTUID, next_uid, 0)
++F(MATROSKA_ID_TIMECODESCALE, timecode_scale, 0)
++F(MATROSKA_ID_DATEUTC, date_utc, 0)
++F(MATROSKA_ID_TITLE, title, 0)
++F(MATROSKA_ID_MUXINGAPP, muxing_app, 0)
++F(MATROSKA_ID_WRITINGAPP, writing_app, 0)
++F(MATROSKA_ID_DURATION, duration, 0)
+}};
+#undef N
+
-+#define N chapter_atom
-+E_S("ChapterAtom", 8)
-+F(MATROSKA_ID_CHAPTERDISPLAY, chapter_display, 1)
-+F(MATROSKA_ID_CHAPTERFLAGENABLED, chapter_flag_enabled, 0)
-+F(MATROSKA_ID_CHAPTERFLAGHIDDEN, chapter_flag_hidden, 0)
-+F(MATROSKA_ID_CHAPTERSEGMENTEDITIONUID, chapter_segment_edition_uid, 0)
-+F(MATROSKA_ID_CHAPTERSEGMENTUID, chapter_segment_uid, 0)
-+F(MATROSKA_ID_CHAPTERTIMEEND, chapter_time_end, 0)
-+F(MATROSKA_ID_CHAPTERTIMESTART, chapter_time_start, 0)
-+F(MATROSKA_ID_CHAPTERUID, chapter_uid, 0)
++E("SeekPosition", seek_position, EBML_TYPE_UINT)
++
++E("SeekID", seek_id, EBML_TYPE_EBML_ID)
++
++#define N seek
++E_S("Seek", 2)
++F(MATROSKA_ID_SEEKID, seek_id, 0)
++F(MATROSKA_ID_SEEKPOSITION, seek_position, 0)
+}};
+#undef N
+
-+#define N edition_entry
-+E_S("EditionEntry", 5)
-+F(MATROSKA_ID_CHAPTERATOM, chapter_atom, 1)
-+F(MATROSKA_ID_EDITIONFLAGDEFAULT, edition_flag_default, 0)
-+F(MATROSKA_ID_EDITIONFLAGHIDDEN, edition_flag_hidden, 0)
-+F(MATROSKA_ID_EDITIONFLAGORDERED, edition_flag_ordered, 0)
-+F(MATROSKA_ID_EDITIONUID, edition_uid, 0)
++#define N seek_head
++E_S("SeekHead", 1)
++F(MATROSKA_ID_SEEK, seek, 1)
+}};
+#undef N
+
-+#define N chapters
-+E_S("Chapters", 1)
-+F(MATROSKA_ID_EDITIONENTRY, edition_entry, 1)
++#define N segment
++E_S("Segment", 8)
++F(MATROSKA_ID_SEEKHEAD, seek_head, 1)
++F(MATROSKA_ID_INFO, info, 1)
++F(MATROSKA_ID_CLUSTER, cluster, 1)
++F(MATROSKA_ID_TRACKS, tracks, 1)
++F(MATROSKA_ID_CUES, cues, 0)
++F(MATROSKA_ID_ATTACHMENTS, attachments, 0)
++F(MATROSKA_ID_CHAPTERS, chapters, 0)
++F(MATROSKA_ID_TAGS, tags, 1)
+}};
+#undef N
+
-+E("TargetTypeValue", target_type_value, EBML_TYPE_UINT)
-+
-+E("TargetTrackUID", target_track_uid, EBML_TYPE_UINT)
-+
-+E("TargetEditionUID", target_edition_uid, EBML_TYPE_UINT)
-+
-+E("TargetChapterUID", target_chapter_uid, EBML_TYPE_UINT)
++E("Void", void, EBML_TYPE_BINARY)
+
-+E("TargetAttachmentUID", target_attachment_uid, EBML_TYPE_UINT)
++E("CRC32", crc32, EBML_TYPE_BINARY)
+
-+#define N targets
-+E_S("Targets", 5)
-+F(MATROSKA_ID_TARGETATTACHMENTUID, target_attachment_uid, 0)
-+F(MATROSKA_ID_TARGETCHAPTERUID, target_chapter_uid, 0)
-+F(MATROSKA_ID_TARGETEDITIONUID, target_edition_uid, 0)
-+F(MATROSKA_ID_TARGETTRACKUID, target_track_uid, 0)
-+F(MATROSKA_ID_TARGETTYPEVALUE, target_type_value, 0)
-+}};
-+#undef N
++E("DocTypeReadVersion", doc_type_read_version, EBML_TYPE_UINT)
+
-+E("TagName", tag_name, EBML_TYPE_STR)
++E("DocTypeVersion", doc_type_version, EBML_TYPE_UINT)
+
-+E("TagLanguage", tag_language, EBML_TYPE_STR)
++E("DocType", doc_type, EBML_TYPE_STR)
+
-+E("TagString", tag_string, EBML_TYPE_STR)
++E("EBMLMaxSizeLength", ebml_max_size_length, EBML_TYPE_UINT)
+
-+#define N simple_tag
-+E_S("SimpleTag", 3)
-+F(MATROSKA_ID_TAGLANGUAGE, tag_language, 0)
-+F(MATROSKA_ID_TAGNAME, tag_name, 0)
-+F(MATROSKA_ID_TAGSTRING, tag_string, 0)
-+}};
-+#undef N
++E("EBMLMaxIDLength", ebml_max_id_length, EBML_TYPE_UINT)
+
-+#define N tag
-+E_S("Tag", 2)
-+F(MATROSKA_ID_SIMPLETAG, simple_tag, 1)
-+F(MATROSKA_ID_TARGETS, targets, 0)
-+}};
-+#undef N
++E("EBMLReadVersion", ebml_read_version, EBML_TYPE_UINT)
+
-+#define N tags
-+E_S("Tags", 1)
-+F(MATROSKA_ID_TAG, tag, 1)
-+}};
-+#undef N
++E("EBMLVersion", ebml_version, EBML_TYPE_UINT)
+
-+#define N segment
-+E_S("Segment", 8)
-+F(MATROSKA_ID_ATTACHMENTS, attachments, 0)
-+F(MATROSKA_ID_CHAPTERS, chapters, 0)
-+F(MATROSKA_ID_CLUSTER, cluster, 1)
-+F(MATROSKA_ID_CUES, cues, 0)
-+F(MATROSKA_ID_INFO, info, 1)
-+F(MATROSKA_ID_SEEKHEAD, seek_head, 1)
-+F(MATROSKA_ID_TAGS, tags, 1)
-+F(MATROSKA_ID_TRACKS, tracks, 1)
++#define N ebml
++E_S("EBML", 7)
++F(EBML_ID_EBMLVERSION, ebml_version, 0)
++F(EBML_ID_EBMLREADVERSION, ebml_read_version, 0)
++F(EBML_ID_EBMLMAXIDLENGTH, ebml_max_id_length, 0)
++F(EBML_ID_EBMLMAXSIZELENGTH, ebml_max_size_length, 0)
++F(EBML_ID_DOCTYPE, doc_type, 0)
++F(EBML_ID_DOCTYPEVERSION, doc_type_version, 0)
++F(EBML_ID_DOCTYPEREADVERSION, doc_type_read_version, 0)
+}};
+#undef N
diff --git a/demux/ebml_types.h b/demux/ebml_types.h
new file mode 100644
-index 000000000..4c61d77a0
+index 000000000..510a766e1
--- /dev/null
+++ b/demux/ebml_types.h
-@@ -0,0 +1,587 @@
-+/* Generated by TOOLS/matroska.pl, do not edit manually */
+@@ -0,0 +1,586 @@
++// Generated by TOOLS/matroska.py, do not edit manually
+
++#define EBML_ID_EBML 0x1a45dfa3
+#define EBML_ID_EBMLVERSION 0x4286
+#define EBML_ID_EBMLREADVERSION 0x42f7
+#define EBML_ID_EBMLMAXIDLENGTH 0x42f2
@@ -564,13 +565,14 @@ index 000000000..4c61d77a0
+#define EBML_ID_DOCTYPE 0x4282
+#define EBML_ID_DOCTYPEVERSION 0x4287
+#define EBML_ID_DOCTYPEREADVERSION 0x4285
-+#define EBML_ID_EBML 0x1a45dfa3
+#define EBML_ID_CRC32 0xbf
+#define EBML_ID_VOID 0xec
++#define MATROSKA_ID_SEGMENT 0x18538067
++#define MATROSKA_ID_SEEKHEAD 0x114d9b74
++#define MATROSKA_ID_SEEK 0x4dbb
+#define MATROSKA_ID_SEEKID 0x53ab
+#define MATROSKA_ID_SEEKPOSITION 0x53ac
-+#define MATROSKA_ID_SEEK 0x4dbb
-+#define MATROSKA_ID_SEEKHEAD 0x114d9b74
++#define MATROSKA_ID_INFO 0x1549a966
+#define MATROSKA_ID_SEGMENTUID 0x73a4
+#define MATROSKA_ID_PREVUID 0x3cb923
+#define MATROSKA_ID_NEXTUID 0x3eb923
@@ -580,15 +582,16 @@ index 000000000..4c61d77a0
+#define MATROSKA_ID_MUXINGAPP 0x4d80
+#define MATROSKA_ID_WRITINGAPP 0x5741
+#define MATROSKA_ID_DURATION 0x4489
-+#define MATROSKA_ID_INFO 0x1549a966
++#define MATROSKA_ID_CLUSTER 0x1f43b675
+#define MATROSKA_ID_TIMECODE 0xe7
++#define MATROSKA_ID_BLOCKGROUP 0xa0
+#define MATROSKA_ID_BLOCK 0xa1
+#define MATROSKA_ID_BLOCKDURATION 0x9b
+#define MATROSKA_ID_REFERENCEBLOCK 0xfb
+#define MATROSKA_ID_DISCARDPADDING 0x75A2
-+#define MATROSKA_ID_BLOCKGROUP 0xa0
+#define MATROSKA_ID_SIMPLEBLOCK 0xa3
-+#define MATROSKA_ID_CLUSTER 0x1f43b675
++#define MATROSKA_ID_TRACKS 0x1654ae6b
++#define MATROSKA_ID_TRACKENTRY 0xae
+#define MATROSKA_ID_TRACKNUMBER 0xd7
+#define MATROSKA_ID_TRACKUID 0x73c5
+#define MATROSKA_ID_TRACKTYPE 0x83
@@ -607,8 +610,9 @@ index 000000000..4c61d77a0
+#define MATROSKA_ID_CODECPRIVATE 0x63a2
+#define MATROSKA_ID_CODECNAME 0x258688
+#define MATROSKA_ID_CODECDECODEALL 0xaa
-+#define MATROSKA_ID_CODECDELAY 0x56AA
-+#define MATROSKA_ID_SEEKPREROLL 0x56BB
++#define MATROSKA_ID_CODECDELAY 0x56aa
++#define MATROSKA_ID_SEEKPREROLL 0x56bb
++#define MATROSKA_ID_VIDEO 0xe0
+#define MATROSKA_ID_FLAGINTERLACED 0x9a
+#define MATROSKA_ID_PIXELWIDTH 0xb0
+#define MATROSKA_ID_PIXELHEIGHT 0xba
@@ -618,6 +622,7 @@ index 000000000..4c61d77a0
+#define MATROSKA_ID_FRAMERATE 0x2383e3
+#define MATROSKA_ID_COLOURSPACE 0x2eb524
+#define MATROSKA_ID_STEREOMODE 0x53b8
++#define MATROSKA_ID_COLOUR 0x55b0
+#define MATROSKA_ID_MATRIXCOEFFICIENTS 0x55B1
+#define MATROSKA_ID_BITSPERCHANNEL 0x55B2
+#define MATROSKA_ID_CHROMASUBSAMPLINGHORZ 0x55B3
@@ -631,6 +636,7 @@ index 000000000..4c61d77a0
+#define MATROSKA_ID_PRIMARIES 0x55BB
+#define MATROSKA_ID_MAXCLL 0x55BC
+#define MATROSKA_ID_MAXFALL 0x55BD
++#define MATROSKA_ID_MASTERINGMETADATA 0x55D0
+#define MATROSKA_ID_PRIMARYRCHROMATICITYX 0x55D1
+#define MATROSKA_ID_PRIMARYRCHROMATICITYY 0x55D2
+#define MATROSKA_ID_PRIMARYGCHROMATICITYX 0x55D3
@@ -641,43 +647,41 @@ index 000000000..4c61d77a0
+#define MATROSKA_ID_WHITEPOINTCHROMATICITYY 0x55D8
+#define MATROSKA_ID_LUMINANCEMAX 0x55D9
+#define MATROSKA_ID_LUMINANCEMIN 0x55DA
-+#define MATROSKA_ID_MASTERINGMETADATA 0x55D0
-+#define MATROSKA_ID_COLOUR 0x55B0
-+#define MATROSKA_ID_VIDEO 0xe0
++#define MATROSKA_ID_AUDIO 0xe1
+#define MATROSKA_ID_SAMPLINGFREQUENCY 0xb5
+#define MATROSKA_ID_OUTPUTSAMPLINGFREQUENCY 0x78b5
+#define MATROSKA_ID_CHANNELS 0x9f
+#define MATROSKA_ID_BITDEPTH 0x6264
-+#define MATROSKA_ID_AUDIO 0xe1
++#define MATROSKA_ID_CONTENTENCODINGS 0x6d80
++#define MATROSKA_ID_CONTENTENCODING 0x6240
+#define MATROSKA_ID_CONTENTENCODINGORDER 0x5031
+#define MATROSKA_ID_CONTENTENCODINGSCOPE 0x5032
+#define MATROSKA_ID_CONTENTENCODINGTYPE 0x5033
++#define MATROSKA_ID_CONTENTCOMPRESSION 0x5034
+#define MATROSKA_ID_CONTENTCOMPALGO 0x4254
+#define MATROSKA_ID_CONTENTCOMPSETTINGS 0x4255
-+#define MATROSKA_ID_CONTENTCOMPRESSION 0x5034
-+#define MATROSKA_ID_CONTENTENCODING 0x6240
-+#define MATROSKA_ID_CONTENTENCODINGS 0x6d80
-+#define MATROSKA_ID_TRACKENTRY 0xae
-+#define MATROSKA_ID_TRACKS 0x1654ae6b
++#define MATROSKA_ID_CUES 0x1c53bb6b
++#define MATROSKA_ID_CUEPOINT 0xbb
+#define MATROSKA_ID_CUETIME 0xb3
++#define MATROSKA_ID_CUETRACKPOSITIONS 0xb7
+#define MATROSKA_ID_CUETRACK 0xf7
+#define MATROSKA_ID_CUECLUSTERPOSITION 0xf1
+#define MATROSKA_ID_CUERELATIVEPOSITION 0xf0
+#define MATROSKA_ID_CUEDURATION 0xb2
-+#define MATROSKA_ID_CUETRACKPOSITIONS 0xb7
-+#define MATROSKA_ID_CUEPOINT 0xbb
-+#define MATROSKA_ID_CUES 0x1c53bb6b
++#define MATROSKA_ID_ATTACHMENTS 0x1941a469
++#define MATROSKA_ID_ATTACHEDFILE 0x61a7
+#define MATROSKA_ID_FILEDESCRIPTION 0x467e
+#define MATROSKA_ID_FILENAME 0x466e
+#define MATROSKA_ID_FILEMIMETYPE 0x4660
+#define MATROSKA_ID_FILEDATA 0x465c
+#define MATROSKA_ID_FILEUID 0x46ae
-+#define MATROSKA_ID_ATTACHEDFILE 0x61a7
-+#define MATROSKA_ID_ATTACHMENTS 0x1941a469
++#define MATROSKA_ID_CHAPTERS 0x1043a770
++#define MATROSKA_ID_EDITIONENTRY 0x45b9
+#define MATROSKA_ID_EDITIONUID 0x45bc
+#define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45bd
+#define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45db
+#define MATROSKA_ID_EDITIONFLAGORDERED 0x45dd
++#define MATROSKA_ID_CHAPTERATOM 0xb6
+#define MATROSKA_ID_CHAPTERUID 0x73c4
+#define MATROSKA_ID_CHAPTERTIMESTART 0x91
+#define MATROSKA_ID_CHAPTERTIMEEND 0x92
@@ -685,461 +689,456 @@ index 000000000..4c61d77a0
+#define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598
+#define MATROSKA_ID_CHAPTERSEGMENTUID 0x6e67
+#define MATROSKA_ID_CHAPTERSEGMENTEDITIONUID 0x6ebc
++#define MATROSKA_ID_CHAPTERDISPLAY 0x80
+#define MATROSKA_ID_CHAPSTRING 0x85
+#define MATROSKA_ID_CHAPLANGUAGE 0x437c
+#define MATROSKA_ID_CHAPCOUNTRY 0x437e
-+#define MATROSKA_ID_CHAPTERDISPLAY 0x80
-+#define MATROSKA_ID_CHAPTERATOM 0xb6
-+#define MATROSKA_ID_EDITIONENTRY 0x45b9
-+#define MATROSKA_ID_CHAPTERS 0x1043a770
++#define MATROSKA_ID_TAGS 0x1254c367
++#define MATROSKA_ID_TAG 0x7373
++#define MATROSKA_ID_TARGETS 0x63c0
+#define MATROSKA_ID_TARGETTYPEVALUE 0x68ca
+#define MATROSKA_ID_TARGETTRACKUID 0x63c5
+#define MATROSKA_ID_TARGETEDITIONUID 0x63c9
+#define MATROSKA_ID_TARGETCHAPTERUID 0x63c4
+#define MATROSKA_ID_TARGETATTACHMENTUID 0x63c6
-+#define MATROSKA_ID_TARGETS 0x63c0
++#define MATROSKA_ID_SIMPLETAG 0x67c8
+#define MATROSKA_ID_TAGNAME 0x45a3
+#define MATROSKA_ID_TAGLANGUAGE 0x447a
+#define MATROSKA_ID_TAGSTRING 0x4487
-+#define MATROSKA_ID_SIMPLETAG 0x67c8
-+#define MATROSKA_ID_TAG 0x7373
-+#define MATROSKA_ID_TAGS 0x1254c367
-+#define MATROSKA_ID_SEGMENT 0x18538067
-+
+
-+struct ebml_ebml {
-+ char * doc_type;
-+ uint64_t doc_type_read_version;
-+ uint64_t doc_type_version;
-+ uint64_t ebml_max_id_length;
-+ uint64_t ebml_max_size_length;
-+ uint64_t ebml_read_version;
-+ uint64_t ebml_version;
-+
-+ int n_ebml_version;
-+ int n_ebml_max_id_length;
-+ int n_ebml_max_size_length;
-+ int n_doc_type;
-+ int n_doc_type_version;
-+ int n_doc_type_read_version;
-+ int n_ebml_read_version;
-+};
+
-+struct ebml_seek {
-+ uint32_t seek_id;
-+ uint64_t seek_position;
-+
-+ int n_seek_position;
-+ int n_seek_id;
-+};
-+
-+struct ebml_seek_head {
-+ struct ebml_seek *seek;
-+
-+ int n_seek;
-+};
++struct ebml_simple_tag {
++ char * tag_name;
++ char * tag_language;
++ char * tag_string;
+
-+struct ebml_info {
-+ int64_t date_utc;
-+ double duration;
-+ char * muxing_app;
-+ struct bstr next_uid;
-+ struct bstr prev_uid;
-+ struct bstr segment_uid;
-+ uint64_t timecode_scale;
-+ char * title;
-+ char * writing_app;
-+
-+ int n_segment_uid;
-+ int n_prev_uid;
-+ int n_next_uid;
-+ int n_timecode_scale;
-+ int n_date_utc;
-+ int n_title;
-+ int n_muxing_app;
-+ int n_writing_app;
-+ int n_duration;
++ int n_tag_name;
++ int n_tag_language;
++ int n_tag_string;
+};
+
-+struct ebml_block_group {
-+ struct bstr block;
-+ uint64_t block_duration;
-+ int64_t discard_padding;
-+ int64_t *reference_block;
-+
-+ int n_block;
-+ int n_block_duration;
-+ int n_reference_block;
-+ int n_discard_padding;
++struct ebml_targets {
++ uint64_t target_type_value;
++ uint64_t target_track_uid;
++ uint64_t target_edition_uid;
++ uint64_t target_chapter_uid;
++ uint64_t target_attachment_uid;
++
++ int n_target_type_value;
++ int n_target_track_uid;
++ int n_target_edition_uid;
++ int n_target_chapter_uid;
++ int n_target_attachment_uid;
+};
+
-+struct ebml_cluster {
-+ struct ebml_block_group *block_group;
-+ struct bstr *simple_block;
-+ uint64_t timecode;
++struct ebml_tag {
++ struct ebml_targets targets;
++ struct ebml_simple_tag *simple_tag;
+
-+ int n_timecode;
-+ int n_block_group;
-+ int n_simple_block;
++ int n_targets;
++ int n_simple_tag;
+};
+
-+struct ebml_mastering_metadata {
-+ double luminance_max;
-+ double luminance_min;
-+ double primary_b_chromaticity_x;
-+ double primary_b_chromaticity_y;
-+ double primary_g_chromaticity_x;
-+ double primary_g_chromaticity_y;
-+ double primary_r_chromaticity_x;
-+ double primary_r_chromaticity_y;
-+ double white_point_chromaticity_x;
-+ double white_point_chromaticity_y;
-+
-+ int n_primary_r_chromaticity_x;
-+ int n_primary_r_chromaticity_y;
-+ int n_primary_g_chromaticity_x;
-+ int n_primary_g_chromaticity_y;
-+ int n_primary_b_chromaticity_x;
-+ int n_primary_b_chromaticity_y;
-+ int n_white_point_chromaticity_x;
-+ int n_white_point_chromaticity_y;
-+ int n_luminance_max;
-+ int n_luminance_min;
-+};
++struct ebml_tags {
++ struct ebml_tag *tag;
+
-+struct ebml_colour {
-+ uint64_t bits_per_channel;
-+ uint64_t cb_subsampling_horz;
-+ uint64_t cb_subsampling_vert;
-+ uint64_t chroma_siting_horz;
-+ uint64_t chroma_siting_vert;
-+ uint64_t chroma_subsampling_horz;
-+ uint64_t chroma_subsampling_vert;
-+ struct ebml_mastering_metadata mastering_metadata;
-+ uint64_t matrix_coefficients;
-+ uint64_t max_cll;
-+ uint64_t max_fall;
-+ uint64_t primaries;
-+ uint64_t range;
-+ uint64_t transfer_characteristics;
-+
-+ int n_matrix_coefficients;
-+ int n_bits_per_channel;
-+ int n_chroma_subsampling_horz;
-+ int n_chroma_subsampling_vert;
-+ int n_cb_subsampling_horz;
-+ int n_cb_subsampling_vert;
-+ int n_chroma_siting_horz;
-+ int n_chroma_siting_vert;
-+ int n_range;
-+ int n_transfer_characteristics;
-+ int n_primaries;
-+ int n_max_cll;
-+ int n_max_fall;
-+ int n_mastering_metadata;
++ int n_tag;
+};
+
-+struct ebml_video {
-+ struct ebml_colour colour;
-+ struct bstr colour_space;
-+ uint64_t display_height;
-+ uint64_t display_unit;
-+ uint64_t display_width;
-+ uint64_t flag_interlaced;
-+ double frame_rate;
-+ uint64_t pixel_height;
-+ uint64_t pixel_width;
-+ uint64_t stereo_mode;
-+
-+ int n_flag_interlaced;
-+ int n_pixel_width;
-+ int n_pixel_height;
-+ int n_display_width;
-+ int n_display_height;
-+ int n_display_unit;
-+ int n_frame_rate;
-+ int n_colour_space;
-+ int n_stereo_mode;
-+ int n_colour;
-+};
++struct ebml_chapter_display {
++ char * chap_string;
++ char * *chap_language;
++ char * *chap_country;
+
-+struct ebml_audio {
-+ uint64_t bit_depth;
-+ uint64_t channels;
-+ double output_sampling_frequency;
-+ double sampling_frequency;
-+
-+ int n_sampling_frequency;
-+ int n_output_sampling_frequency;
-+ int n_channels;
-+ int n_bit_depth;
++ int n_chap_string;
++ int n_chap_language;
++ int n_chap_country;
+};
+
-+struct ebml_content_compression {
-+ uint64_t content_comp_algo;
-+ struct bstr content_comp_settings;
-+
-+ int n_content_comp_algo;
-+ int n_content_comp_settings;
++struct ebml_chapter_atom {
++ uint64_t chapter_uid;
++ uint64_t chapter_time_start;
++ uint64_t chapter_time_end;
++ uint64_t chapter_flag_hidden;
++ uint64_t chapter_flag_enabled;
++ bstr chapter_segment_uid;
++ uint64_t chapter_segment_edition_uid;
++ struct ebml_chapter_display *chapter_display;
++
++ int n_chapter_uid;
++ int n_chapter_time_start;
++ int n_chapter_time_end;
++ int n_chapter_flag_hidden;
++ int n_chapter_flag_enabled;
++ int n_chapter_segment_uid;
++ int n_chapter_segment_edition_uid;
++ int n_chapter_display;
+};
+
-+struct ebml_content_encoding {
-+ struct ebml_content_compression content_compression;
-+ uint64_t content_encoding_order;
-+ uint64_t content_encoding_scope;
-+ uint64_t content_encoding_type;
-+
-+ int n_content_encoding_order;
-+ int n_content_encoding_scope;
-+ int n_content_encoding_type;
-+ int n_content_compression;
++struct ebml_edition_entry {
++ uint64_t edition_uid;
++ uint64_t edition_flag_hidden;
++ uint64_t edition_flag_default;
++ uint64_t edition_flag_ordered;
++ struct ebml_chapter_atom *chapter_atom;
++
++ int n_edition_uid;
++ int n_edition_flag_hidden;
++ int n_edition_flag_default;
++ int n_edition_flag_ordered;
++ int n_chapter_atom;
+};
+
-+struct ebml_content_encodings {
-+ struct ebml_content_encoding *content_encoding;
++struct ebml_chapters {
++ struct ebml_edition_entry *edition_entry;
+
-+ int n_content_encoding;
++ int n_edition_entry;
+};
+
-+struct ebml_track_entry {
-+ struct ebml_audio audio;
-+ uint64_t codec_decode_all;
-+ uint64_t codec_delay;
-+ char * codec_id;
-+ char * codec_name;
-+ struct bstr codec_private;
-+ struct ebml_content_encodings content_encodings;
-+ uint64_t default_duration;
-+ uint64_t flag_default;
-+ uint64_t flag_enabled;
-+ uint64_t flag_forced;
-+ uint64_t flag_lacing;
-+ char * language;
-+ uint64_t max_block_addition_id;
-+ uint64_t max_cache;
-+ uint64_t min_cache;
-+ char * name;
-+ uint64_t seek_pre_roll;
-+ uint64_t track_number;
-+ double track_timecode_scale;
-+ uint64_t track_type;
-+ uint64_t track_uid;
-+ struct ebml_video video;
-+
-+ int n_track_number;
-+ int n_track_uid;
-+ int n_track_type;
-+ int n_flag_enabled;
-+ int n_flag_default;
-+ int n_flag_forced;
-+ int n_flag_lacing;
-+ int n_min_cache;
-+ int n_max_cache;
-+ int n_default_duration;
-+ int n_track_timecode_scale;
-+ int n_max_block_addition_id;
-+ int n_name;
-+ int n_language;
-+ int n_codec_id;
-+ int n_codec_private;
-+ int n_codec_name;
-+ int n_codec_decode_all;
-+ int n_codec_delay;
-+ int n_seek_pre_roll;
-+ int n_video;
-+ int n_audio;
-+ int n_content_encodings;
++struct ebml_attached_file {
++ char * file_description;
++ char * file_name;
++ char * file_mime_type;
++ bstr file_data;
++ uint64_t file_uid;
++
++ int n_file_description;
++ int n_file_name;
++ int n_file_mime_type;
++ int n_file_data;
++ int n_file_uid;
+};
+
-+struct ebml_tracks {
-+ struct ebml_track_entry *track_entry;
++struct ebml_attachments {
++ struct ebml_attached_file *attached_file;
+
-+ int n_track_entry;
++ int n_attached_file;
+};
+
+struct ebml_cue_track_positions {
-+ uint64_t cue_cluster_position;
-+ uint64_t cue_duration;
-+ uint64_t cue_relative_position;
-+ uint64_t cue_track;
-+
-+ int n_cue_track;
-+ int n_cue_cluster_position;
-+ int n_cue_relative_position;
-+ int n_cue_duration;
++ uint64_t cue_track;
++ uint64_t cue_cluster_position;
++ uint64_t cue_relative_position;
++ uint64_t cue_duration;
++
++ int n_cue_track;
++ int n_cue_cluster_position;
++ int n_cue_relative_position;
++ int n_cue_duration;
+};
+
+struct ebml_cue_point {
-+ uint64_t cue_time;
-+ struct ebml_cue_track_positions *cue_track_positions;
++ uint64_t cue_time;
++ struct ebml_cue_track_positions *cue_track_positions;
+
-+ int n_cue_time;
-+ int n_cue_track_positions;
++ int n_cue_time;
++ int n_cue_track_positions;
+};
+
+struct ebml_cues {
-+ struct ebml_cue_point *cue_point;
++ struct ebml_cue_point *cue_point;
+
-+ int n_cue_point;
++ int n_cue_point;
+};
+
-+struct ebml_attached_file {
-+ struct bstr file_data;
-+ char * file_description;
-+ char * file_mime_type;
-+ char * file_name;
-+ uint64_t file_uid;
-+
-+ int n_file_description;
-+ int n_file_name;
-+ int n_file_mime_type;
-+ int n_file_data;
-+ int n_file_uid;
++struct ebml_content_compression {
++ uint64_t content_comp_algo;
++ bstr content_comp_settings;
++
++ int n_content_comp_algo;
++ int n_content_comp_settings;
+};
+
-+struct ebml_attachments {
-+ struct ebml_attached_file *attached_file;
++struct ebml_content_encoding {
++ uint64_t content_encoding_order;
++ uint64_t content_encoding_scope;
++ uint64_t content_encoding_type;
++ struct ebml_content_compression content_compression;
++
++ int n_content_encoding_order;
++ int n_content_encoding_scope;
++ int n_content_encoding_type;
++ int n_content_compression;
++};
+
-+ int n_attached_file;
++struct ebml_content_encodings {
++ struct ebml_content_encoding *content_encoding;
++
++ int n_content_encoding;
+};
+
-+struct ebml_chapter_display {
-+ char * *chap_country;
-+ char * *chap_language;
-+ char * chap_string;
++struct ebml_audio {
++ double sampling_frequency;
++ double output_sampling_frequency;
++ uint64_t channels;
++ uint64_t bit_depth;
++
++ int n_sampling_frequency;
++ int n_output_sampling_frequency;
++ int n_channels;
++ int n_bit_depth;
++};
+
-+ int n_chap_string;
-+ int n_chap_language;
-+ int n_chap_country;
++struct ebml_mastering_metadata {
++ double primary_r_chromaticity_x;
++ double primary_r_chromaticity_y;
++ double primary_g_chromaticity_x;
++ double primary_g_chromaticity_y;
++ double primary_b_chromaticity_x;
++ double primary_b_chromaticity_y;
++ double white_point_chromaticity_x;
++ double white_point_chromaticity_y;
++ double luminance_max;
++ double luminance_min;
++
++ int n_primary_r_chromaticity_x;
++ int n_primary_r_chromaticity_y;
++ int n_primary_g_chromaticity_x;
++ int n_primary_g_chromaticity_y;
++ int n_primary_b_chromaticity_x;
++ int n_primary_b_chromaticity_y;
++ int n_white_point_chromaticity_x;
++ int n_white_point_chromaticity_y;
++ int n_luminance_max;
++ int n_luminance_min;
+};
+
-+struct ebml_chapter_atom {
-+ struct ebml_chapter_display *chapter_display;
-+ uint64_t chapter_flag_enabled;
-+ uint64_t chapter_flag_hidden;
-+ uint64_t chapter_segment_edition_uid;
-+ struct bstr chapter_segment_uid;
-+ uint64_t chapter_time_end;
-+ uint64_t chapter_time_start;
-+ uint64_t chapter_uid;
-+
-+ int n_chapter_uid;
-+ int n_chapter_time_start;
-+ int n_chapter_time_end;
-+ int n_chapter_flag_hidden;
-+ int n_chapter_flag_enabled;
-+ int n_chapter_segment_uid;
-+ int n_chapter_segment_edition_uid;
-+ int n_chapter_display;
++struct ebml_colour {
++ uint64_t matrix_coefficients;
++ uint64_t bits_per_channel;
++ uint64_t chroma_subsampling_horz;
++ uint64_t chroma_subsampling_vert;
++ uint64_t cb_subsampling_horz;
++ uint64_t cb_subsampling_vert;
++ uint64_t chroma_siting_horz;
++ uint64_t chroma_siting_vert;
++ uint64_t range;
++ uint64_t transfer_characteristics;
++ uint64_t primaries;
++ uint64_t max_cll;
++ uint64_t max_fall;
++ struct ebml_mastering_metadata mastering_metadata;
++
++ int n_matrix_coefficients;
++ int n_bits_per_channel;
++ int n_chroma_subsampling_horz;
++ int n_chroma_subsampling_vert;
++ int n_cb_subsampling_horz;
++ int n_cb_subsampling_vert;
++ int n_chroma_siting_horz;
++ int n_chroma_siting_vert;
++ int n_range;
++ int n_transfer_characteristics;
++ int n_primaries;
++ int n_max_cll;
++ int n_max_fall;
++ int n_mastering_metadata;
+};
+
-+struct ebml_edition_entry {
-+ struct ebml_chapter_atom *chapter_atom;
-+ uint64_t edition_flag_default;
-+ uint64_t edition_flag_hidden;
-+ uint64_t edition_flag_ordered;
-+ uint64_t edition_uid;
-+
-+ int n_edition_uid;
-+ int n_edition_flag_hidden;
-+ int n_edition_flag_default;
-+ int n_edition_flag_ordered;
-+ int n_chapter_atom;
++struct ebml_video {
++ uint64_t flag_interlaced;
++ uint64_t pixel_width;
++ uint64_t pixel_height;
++ uint64_t display_width;
++ uint64_t display_height;
++ uint64_t display_unit;
++ double frame_rate;
++ bstr colour_space;
++ uint64_t stereo_mode;
++ struct ebml_colour colour;
++
++ int n_flag_interlaced;
++ int n_pixel_width;
++ int n_pixel_height;
++ int n_display_width;
++ int n_display_height;
++ int n_display_unit;
++ int n_frame_rate;
++ int n_colour_space;
++ int n_stereo_mode;
++ int n_colour;
+};
+
-+struct ebml_chapters {
-+ struct ebml_edition_entry *edition_entry;
++struct ebml_track_entry {
++ uint64_t track_number;
++ uint64_t track_uid;
++ uint64_t track_type;
++ uint64_t flag_enabled;
++ uint64_t flag_default;
++ uint64_t flag_forced;
++ uint64_t flag_lacing;
++ uint64_t min_cache;
++ uint64_t max_cache;
++ uint64_t default_duration;
++ double track_timecode_scale;
++ uint64_t max_block_addition_id;
++ char * name;
++ char * language;
++ char * codec_id;
++ bstr codec_private;
++ char * codec_name;
++ uint64_t codec_decode_all;
++ uint64_t codec_delay;
++ uint64_t seek_pre_roll;
++ struct ebml_video video;
++ struct ebml_audio audio;
++ struct ebml_content_encodings content_encodings;
++
++ int n_track_number;
++ int n_track_uid;
++ int n_track_type;
++ int n_flag_enabled;
++ int n_flag_default;
++ int n_flag_forced;
++ int n_flag_lacing;
++ int n_min_cache;
++ int n_max_cache;
++ int n_default_duration;
++ int n_track_timecode_scale;
++ int n_max_block_addition_id;
++ int n_name;
++ int n_language;
++ int n_codec_id;
++ int n_codec_private;
++ int n_codec_name;
++ int n_codec_decode_all;
++ int n_codec_delay;
++ int n_seek_pre_roll;
++ int n_video;
++ int n_audio;
++ int n_content_encodings;
++};
+
-+ int n_edition_entry;
++struct ebml_tracks {
++ struct ebml_track_entry *track_entry;
++
++ int n_track_entry;
+};
+
-+struct ebml_targets {
-+ uint64_t target_attachment_uid;
-+ uint64_t target_chapter_uid;
-+ uint64_t target_edition_uid;
-+ uint64_t target_track_uid;
-+ uint64_t target_type_value;
-+
-+ int n_target_type_value;
-+ int n_target_track_uid;
-+ int n_target_edition_uid;
-+ int n_target_chapter_uid;
-+ int n_target_attachment_uid;
++struct ebml_block_group {
++ bstr block;
++ uint64_t block_duration;
++ int64_t *reference_block;
++ int64_t discard_padding;
++
++ int n_block;
++ int n_block_duration;
++ int n_reference_block;
++ int n_discard_padding;
+};
+
-+struct ebml_simple_tag {
-+ char * tag_language;
-+ char * tag_name;
-+ char * tag_string;
++struct ebml_cluster {
++ uint64_t timecode;
++ struct ebml_block_group *block_group;
++ bstr *simple_block;
+
-+ int n_tag_name;
-+ int n_tag_language;
-+ int n_tag_string;
++ int n_timecode;
++ int n_block_group;
++ int n_simple_block;
+};
+
-+struct ebml_tag {
-+ struct ebml_simple_tag *simple_tag;
-+ struct ebml_targets targets;
++struct ebml_info {
++ bstr segment_uid;
++ bstr prev_uid;
++ bstr next_uid;
++ uint64_t timecode_scale;
++ int64_t date_utc;
++ char * title;
++ char * muxing_app;
++ char * writing_app;
++ double duration;
++
++ int n_segment_uid;
++ int n_prev_uid;
++ int n_next_uid;
++ int n_timecode_scale;
++ int n_date_utc;
++ int n_title;
++ int n_muxing_app;
++ int n_writing_app;
++ int n_duration;
++};
++
++struct ebml_seek {
++ uint32_t seek_id;
++ uint64_t seek_position;
+
-+ int n_targets;
-+ int n_simple_tag;
++ int n_seek_id;
++ int n_seek_position;
+};
+
-+struct ebml_tags {
-+ struct ebml_tag *tag;
++struct ebml_seek_head {
++ struct ebml_seek *seek;
+
-+ int n_tag;
++ int n_seek;
+};
+
+struct ebml_segment {
-+ struct ebml_attachments attachments;
-+ struct ebml_chapters chapters;
-+ struct ebml_cluster *cluster;
-+ struct ebml_cues cues;
-+ struct ebml_info *info;
-+ struct ebml_seek_head *seek_head;
-+ struct ebml_tags *tags;
-+ struct ebml_tracks *tracks;
-+
-+ int n_seek_head;
-+ int n_info;
-+ int n_cluster;
-+ int n_tracks;
-+ int n_cues;
-+ int n_attachments;
-+ int n_chapters;
-+ int n_tags;
++ struct ebml_seek_head *seek_head;
++ struct ebml_info *info;
++ struct ebml_cluster *cluster;
++ struct ebml_tracks *tracks;
++ struct ebml_cues cues;
++ struct ebml_attachments attachments;
++ struct ebml_chapters chapters;
++ struct ebml_tags *tags;
++
++ int n_seek_head;
++ int n_info;
++ int n_cluster;
++ int n_tracks;
++ int n_cues;
++ int n_attachments;
++ int n_chapters;
++ int n_tags;
+};
+
++struct ebml_ebml {
++ uint64_t ebml_version;
++ uint64_t ebml_read_version;
++ uint64_t ebml_max_id_length;
++ uint64_t ebml_max_size_length;
++ char * doc_type;
++ uint64_t doc_type_version;
++ uint64_t doc_type_read_version;
++
++ int n_ebml_version;
++ int n_ebml_read_version;
++ int n_ebml_max_id_length;
++ int n_ebml_max_size_length;
++ int n_doc_type;
++ int n_doc_type_version;
++ int n_doc_type_read_version;
++};
+extern const struct ebml_elem_desc ebml_ebml_desc;
-+extern const struct ebml_elem_desc ebml_seek_desc;
++extern const struct ebml_elem_desc ebml_segment_desc;
+extern const struct ebml_elem_desc ebml_seek_head_desc;
++extern const struct ebml_elem_desc ebml_seek_desc;
+extern const struct ebml_elem_desc ebml_info_desc;
-+extern const struct ebml_elem_desc ebml_block_group_desc;
+extern const struct ebml_elem_desc ebml_cluster_desc;
-+extern const struct ebml_elem_desc ebml_mastering_metadata_desc;
-+extern const struct ebml_elem_desc ebml_colour_desc;
++extern const struct ebml_elem_desc ebml_block_group_desc;
++extern const struct ebml_elem_desc ebml_tracks_desc;
++extern const struct ebml_elem_desc ebml_track_entry_desc;
+extern const struct ebml_elem_desc ebml_video_desc;
++extern const struct ebml_elem_desc ebml_colour_desc;
++extern const struct ebml_elem_desc ebml_mastering_metadata_desc;
+extern const struct ebml_elem_desc ebml_audio_desc;
-+extern const struct ebml_elem_desc ebml_content_compression_desc;
-+extern const struct ebml_elem_desc ebml_content_encoding_desc;
+extern const struct ebml_elem_desc ebml_content_encodings_desc;
-+extern const struct ebml_elem_desc ebml_track_entry_desc;
-+extern const struct ebml_elem_desc ebml_tracks_desc;
-+extern const struct ebml_elem_desc ebml_cue_track_positions_desc;
-+extern const struct ebml_elem_desc ebml_cue_point_desc;
++extern const struct ebml_elem_desc ebml_content_encoding_desc;
++extern const struct ebml_elem_desc ebml_content_compression_desc;
+extern const struct ebml_elem_desc ebml_cues_desc;
-+extern const struct ebml_elem_desc ebml_attached_file_desc;
++extern const struct ebml_elem_desc ebml_cue_point_desc;
++extern const struct ebml_elem_desc ebml_cue_track_positions_desc;
+extern const struct ebml_elem_desc ebml_attachments_desc;
-+extern const struct ebml_elem_desc ebml_chapter_display_desc;
-+extern const struct ebml_elem_desc ebml_chapter_atom_desc;
-+extern const struct ebml_elem_desc ebml_edition_entry_desc;
++extern const struct ebml_elem_desc ebml_attached_file_desc;
+extern const struct ebml_elem_desc ebml_chapters_desc;
++extern const struct ebml_elem_desc ebml_edition_entry_desc;
++extern const struct ebml_elem_desc ebml_chapter_atom_desc;
++extern const struct ebml_elem_desc ebml_chapter_display_desc;
++extern const struct ebml_elem_desc ebml_tags_desc;
++extern const struct ebml_elem_desc ebml_tag_desc;
+extern const struct ebml_elem_desc ebml_targets_desc;
+extern const struct ebml_elem_desc ebml_simple_tag_desc;
-+extern const struct ebml_elem_desc ebml_tag_desc;
-+extern const struct ebml_elem_desc ebml_tags_desc;
-+extern const struct ebml_elem_desc ebml_segment_desc;
+
+#define MAX_EBML_SUBELEMENTS 23
--
diff --git a/pkg/mpv/patch/0003-Add-generated-man-page.patch b/pkg/mpv/patch/0003-Add-generated-man-page.patch
index 5c95cc05..7e10c711 100644
--- a/pkg/mpv/patch/0003-Add-generated-man-page.patch
+++ b/pkg/mpv/patch/0003-Add-generated-man-page.patch
@@ -1,22 +1,22 @@
-From 85c80cb0f48c4d51dd5192b79c543a4b8fd863ec Mon Sep 17 00:00:00 2001
+From 7c5945cec9829ba1d6d692359b9d618669935955 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 2 Jul 2016 21:08:15 -0700
Subject: [PATCH] Add generated man page
This requires python and rst2man to generate.
-$ rst2man.py DOCS/man/mpv.rst DOCS/man/mpv.1
+$ rst2man.py --strip-elements-with-class=contents DOCS/man/mpv.rst DOCS/man/mpv.1
---
- DOCS/man/mpv.1 | 14137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 14137 insertions(+)
+ DOCS/man/mpv.1 | 14084 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 14084 insertions(+)
create mode 100644 DOCS/man/mpv.1
diff --git a/DOCS/man/mpv.1 b/DOCS/man/mpv.1
new file mode 100644
-index 000000000..c411fc606
+index 000000000..f5fa84578
--- /dev/null
+++ b/DOCS/man/mpv.1
-@@ -0,0 +1,14137 @@
+@@ -0,0 +1,14084 @@
+.\" Man page generated from reStructuredText.
+.
+.TH MPV 1 "" "" "multimedia"
@@ -246,9 +246,6 @@ index 000000000..c411fc606
+.TP
+.B command + f (OSX only)
+Toggle fullscreen (see also \fB\-\-fs\fP).
-+.TP
-+.B command + [ and command + ] (OSX only)
-+Set video window alpha.
+.UNINDENT
+.sp
+(The following keys are valid if you have a keyboard with multimedia keys.)
@@ -285,12 +282,38 @@ index 000000000..c411fc606
+.UNINDENT
+.SH USAGE
+.sp
++Command line arguments starting with \fB\-\fP are interpreted as options,
++everything else as filenames or URLs. All options except \fIflag\fP options (or
++choice options which include \fByes\fP) require a parameter in the form
++\fB\-\-option=value\fP\&.
++.sp
++One exception is the lone \fB\-\fP (without anything else), which means media data
++will be read from stdin. Also, \fB\-\-\fP (without anything else) will make the
++player interpret all following arguments as filenames, even if they start with
++\fB\-\fP\&. (To play a file named \fB\-\fP, you need to use \fB\&./\-\fP\&.)
++.sp
+Every \fIflag\fP option has a \fIno\-flag\fP counterpart, e.g. the opposite of the
+\fB\-\-fs\fP option is \fB\-\-no\-fs\fP\&. \fB\-\-fs=yes\fP is same as \fB\-\-fs\fP, \fB\-\-fs=no\fP
+is the same as \fB\-\-no\-fs\fP\&.
+.sp
+If an option is marked as \fI(XXX only)\fP, it will only work in combination with
+the \fIXXX\fP option or if \fIXXX\fP is compiled in.
++.SS Legacy option syntax
++.sp
++The \fB\-\-option=value\fP syntax is not strictly enforced, and the alternative
++legacy syntax \fB\-option value\fP and \fB\-\-option value\fP will also work. This is
++mostly for compatibility with MPlayer. Using these should be avoided. Their
++semantics can change any time in the future.
++.sp
++For example, the alternative syntax will consider an argument following the
++option a filename. \fBmpv \-fs no\fP will attempt to play a file named \fBno\fP,
++because \fB\-\-fs\fP is a flag option that requires no parameter. If an option
++changes and its parameter becomes optional, then a command line using the
++alternative syntax will break.
++.sp
++Currently, the parser makes no difference whether an option starts with \fB\-\-\fP
++or a single \fB\-\fP\&. This might also change in the future, and \fB\-\-option value\fP
++might always interpret \fBvalue\fP as filename in order to reduce ambiguities.
+.SS Escaping spaces and other special characters
+.sp
+Keep in mind that the shell will partially parse and mangle the arguments you
@@ -1123,11 +1146,11 @@ index 000000000..c411fc606
+speed higher than normal automatically inserts the \fBscaletempo\fP audio
+filter.
+.TP
-+.B \fB\-\-loop=<N|inf|force|no>\fP
++.B \fB\-\-loop=<N|inf|force|no>\fP, \fB\-\-loop\fP
+Loops playback \fBN\fP times. A value of \fB1\fP plays it one time (default),
+\fB2\fP two times, etc. \fBinf\fP means forever. \fBno\fP is the same as \fB1\fP and
+disables looping. If several files are specified on command line, the
-+entire playlist is looped.
++entire playlist is looped. \fB\-\-loop\fP is the same as \fB\-\-loop=inf\fP\&.
+.sp
+The \fBforce\fP mode is like \fBinf\fP, but does not skip playlist entries
+which have been marked as failing. This means the player might waste CPU
@@ -1276,6 +1299,26 @@ index 000000000..c411fc606
+Note that \fB\-\-playlist\fP always loads all entries, so you use that instead
+if you really have the need for this functionality.
+.TP
++.B \fB\-\-access\-references=<yes|no>\fP
++Follow any references in the file being opened (default: yes). Disabling
++this is helpful if the file is automatically scanned (e.g. thumbnail
++generation). If the thumbnail scanner for example encounters a playlist
++file, which contains network URLs, and the scanner should not open these,
++enabling this option will prevent it. This option also disables ordered
++chapters, mov reference files, opening of archives, and a number of other
++features.
++.sp
++On older FFmpeg versions, this will not work in some cases. Some FFmpeg
++demuxers might not respect this option.
++.sp
++This option does not prevent opening of paired subtitle files and such. Use
++\fB\-\-autoload\-files=no\fP to prevent this.
++.sp
++This option does not always work if you open non\-files (for example using
++\fBdvd://directory\fP would open a whole bunch of files in the given
++directory). Prefixing the filename with \fB\&./\fP if it doesn\(aqt start with
++a \fB/\fP will avoid this.
++.TP
+.B \fB\-\-loop\-file=<N|inf|no>\fP
+Loop a single file N times. \fBinf\fP means forever, \fBno\fP means normal
+playback. For compatibility, \fB\-\-loop\-file\fP and \fB\-\-loop\-file=yes\fP are
@@ -1342,9 +1385,10 @@ index 000000000..c411fc606
+.B \fB\-\-help\fP, \fB\-\-h\fP
+Show short summary of options.
+.sp
-+You can also pass a shell pattern to this option, which will list all
-+matching top\-level options, e.g. \fB\-\-h=*scale*\fP for all options that
-+contain the word "scale".
++You can also pass a string to this option, which will list all top\-level
++options which contain the string in the name, e.g. \fB\-\-h=scale\fP for all
++options that contain the word \fBscale\fP\&. The special string \fB*\fP lists
++all top\-level options.
+.TP
+.B \fB\-v\fP
+Increment verbosity level, one level for each \fB\-v\fP found on the command
@@ -1570,7 +1614,7 @@ index 000000000..c411fc606
+Specify the video output backend to be used. See \fI\%VIDEO OUTPUT DRIVERS\fP for
+details and descriptions of available drivers.
+.TP
-+.B \fB\-\-vd=<[+|\-]family1:(*|decoder1),[+|\-]family2:(*|decoder2),...[\-]>\fP
++.B \fB\-\-vd=<...>\fP
+Specify a priority list of video decoders to be used, according to their
+family and name. See \fB\-\-ad\fP for further details. Both of these options
+use the same syntax and semantics; the only difference is that they
@@ -1795,8 +1839,8 @@ index 000000000..c411fc606
+mechanism in the opengl output path. To use this deinterlacing you
+must pass the option: \fBvd\-lavc\-o=deint=[weave|bob|adaptive]\fP\&. Pass
+\fBweave\fP to not attempt any deinterlacing.
-+10bit HEVC is available if the hardware supports it but it will be
-+rounded down to 8 bits.
++10 and 12bit HEVC is available if the hardware supports it and a
++sufficiently new driver (> 375.xx) is used.
+.sp
+\fBcuda\-copy\fP has the same behaviour as \fBcuda\fP \- including the ability
+to deinterlace inside the decoder. However, traditional deinterlacing
@@ -2265,11 +2309,10 @@ index 000000000..c411fc606
+Possible codecs are \fBac3\fP, \fBdts\fP, \fBdts\-hd\fP\&. Multiple codecs can be
+specified by separating them with \fB,\fP\&. \fBdts\fP refers to low bitrate DTS
+core, while \fBdts\-hd\fP refers to DTS MA (receiver and OS support varies).
-+You should only use either \fBdts\fP or \fBdts\-hd\fP (if both are specified,
-+and \fBdts\fP comes first, only \fBdts\fP will be used).
++If both \fBdts\fP and \fBdts\-hd\fP are specified, it behaves equivalent to
++specifying \fBdts\-hd\fP only.
+.sp
-+In general, all codecs in the \fBspdif\fP family listed with \fB\-\-ad=help\fP
-+are supported in theory.
++In earlier mpv versions
+.INDENT 7.0
+.INDENT 3.5
+.IP "Warning"
@@ -2282,29 +2325,33 @@ index 000000000..c411fc606
+.TP
+.B \fB\-\-ad=<[+|\-]family1:(*|decoder1),[+|\-]family2:(*|decoder2),...[\-]>\fP
+Specify a priority list of audio decoders to be used, according to their
-+family and decoder name. Entries like \fBfamily:*\fP prioritize all decoders
-+of the given family. When determining which decoder to use, the first
-+decoder that matches the audio format is selected. If that is unavailable,
-+the next decoder is used. Finally, it tries all other decoders that are not
++decoder name. When determining which decoder to use, the first decoder that
++matches the audio format is selected. If that is unavailable, the next
++decoder is used. Finally, it tries all other decoders that are not
+explicitly selected or rejected by the option.
+.sp
++Specifying family names is deprecated. Entries like \fBfamily:*\fP prioritize
++all decoders of the given family.
++.sp
+\fB\-\fP at the end of the list suppresses fallback on other available
+decoders not on the \fB\-\-ad\fP list. \fB+\fP in front of an entry forces the
+decoder. Both of these should not normally be used, because they break
-+normal decoder auto\-selection!
++normal decoder auto\-selection! Both of these methods are deprecated.
+.sp
-+\fB\-\fP in front of an entry disables selection of the decoder.
++\fB\-\fP in front of an entry disables selection of the decoder. This is
++deprecated.
+.INDENT 7.0
+.INDENT 3.5
+.IP "Examples"
+.INDENT 0.0
+.TP
-+.B \fB\-\-ad=lavc:mp3float\fP
++.B \fB\-\-ad=mp3float\fP
+Prefer the FFmpeg/Libav \fBmp3float\fP decoder over all other MP3
+decoders.
+.TP
-+.B \fB\-\-ad=spdif:ac3,lavc:*\fP
-+Always prefer spdif AC3 over FFmpeg/Libav over anything else.
++.B \fB\-\-ad=lavc:mp3float\fP
++Prefer the FFmpeg/Libav \fBmp3float\fP decoder over all other MP3
++decoders. (Using deprecated family syntax.)
+.TP
+.B \fB\-\-ad=help\fP
+List all available decoders.
@@ -3034,82 +3081,43 @@ index 000000000..c411fc606
+.UNINDENT
+.TP
+.B \fB\-\-sub\-codepage=<codepage>\fP
-+If your system supports \fBiconv(3)\fP, you can use this option to specify
-+the subtitle codepage. By default, uchardet will be used to guess the
-+charset. If mpv is not compiled with uchardet, enca will be used.
-+If mpv is compiled with neither uchardet nor enca, \fBUTF\-8:UTF\-8\-BROKEN\fP
-+is the default, which means it will try to use UTF\-8, otherwise the
-+\fBUTF\-8\-BROKEN\fP pseudo codepage (see below).
++You can use this option to specify the subtitle codepage. uchardet will be
++used to guess the charset. (If mpv was not compiled with uchardet, then
++\fButf\-8\fP is the effective default.)
+.sp
-+The default value for this option is \fBauto\fP, whose actual effect depends
-+on whether ENCA is compiled.
-+.INDENT 7.0
-+.INDENT 3.5
-+.IP "Warning"
++The default value for this option is \fBauto\fP, which enables autodetection.
+.sp
-+If you force the charset, even subtitles that are known to be
-+UTF\-8 will be recoded, which is perhaps not what you expect. Prefix
-+codepages with \fButf8:\fP if you want the codepage to be used only if the
-+input is not valid UTF\-8.
-+.UNINDENT
-+.UNINDENT
++The following steps are taken to determine the final codepage, in order:
+.INDENT 7.0
-+.INDENT 3.5
-+.IP "Examples"
-+.INDENT 0.0
+.IP \(bu 2
-+\fB\-\-sub\-codepage=utf8:latin2\fP Use Latin 2 if input is not UTF\-8.
++if the specific codepage has a \fB+\fP, use that codepage
+.IP \(bu 2
-+\fB\-\-sub\-codepage=cp1250\fP Always force recoding to cp1250.
-+.UNINDENT
-+.UNINDENT
++if the data looks like UTF\-8, assume it is UTF\-8
++.IP \(bu 2
++if \fB\-\-sub\-codepage\fP is set to a specific codepage, use that
++.IP \(bu 2
++run uchardet, and if successful, use that
++.IP \(bu 2
++otherwise, use \fBUTF\-8\-BROKEN\fP
+.UNINDENT
-+.sp
-+The pseudo codepage \fBUTF\-8\-BROKEN\fP is used internally. When it
-+is the codepage, subtitles are interpreted as UTF\-8 with "Latin 1" as
-+fallback for bytes which are not valid UTF\-8 sequences. iconv is
-+never involved in this mode.
-+.sp
-+If the player was compiled with ENCA support, you can control it with the
-+following syntax:
-+.sp
-+\fB\-\-sub\-codepage=enca:<language>:<fallback codepage>\fP
-+.sp
-+Language is specified using a two letter code to help ENCA detect
-+the codepage automatically. If an invalid language code is
-+entered, mpv will complain and list valid languages. (Note
-+however that this list will only be printed when the conversion code is actually
-+called, for example when loading an external subtitle). The
-+fallback codepage is used if autodetection fails. If no fallback
-+is specified, \fBUTF\-8\-BROKEN\fP is used.
+.INDENT 7.0
+.INDENT 3.5
+.IP "Examples"
+.INDENT 0.0
+.IP \(bu 2
-+\fB\-\-sub\-codepage=enca:pl:cp1250\fP guess the encoding, assuming the subtitles
-+are Polish, fall back on cp1250
++\fB\-\-sub\-codepage=latin2\fP Use Latin 2 if input is not UTF\-8.
+.IP \(bu 2
-+\fB\-\-sub\-codepage=enca:pl\fP guess the encoding for Polish, fall back on UTF\-8.
-+.IP \(bu 2
-+\fB\-\-sub\-codepage=enca\fP try universal detection, fall back on UTF\-8.
++\fB\-\-sub\-codepage=+cp1250\fP Always force recoding to cp1250.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.sp
-+If the player was compiled with libguess support, you can use it with:
-+.sp
-+\fB\-\-sub\-codepage=guess:<language>:<fallback codepage>\fP
-+.sp
-+libguess always needs a language. There is no universal detection
-+mode. Use \fB\-\-sub\-codepage=guess:help\fP to get a list of
-+languages subject to the same caveat as with ENCA above.
-+.sp
-+If the player was compiled with uchardet support you can use it with:
-+.sp
-+\fB\-\-sub\-codepage=uchardet\fP
++The pseudo codepage \fBUTF\-8\-BROKEN\fP is used internally. If it\(aqs set,
++subtitles are interpreted as UTF\-8 with "Latin 1" as fallback for bytes
++which are not valid UTF\-8 sequences. iconv is never involved in this mode.
+.sp
-+This mode doesn\(aqt take language or fallback codepage.
++This option changed in mpv 0.23.0. The old syntax is still emulated to some
++degree.
+.TP
+.B \fB\-\-sub\-fix\-timing\fP, \fB\-\-no\-sub\-fix\-timing\fP
+By default, subtitle timing is adjusted to remove minor gaps or overlaps
@@ -3411,15 +3419,6 @@ index 000000000..c411fc606
+.UNINDENT
+.sp
+See also \fB\-\-screen\fP\&.
-+.UNINDENT
-+.sp
-+\fB\-\-fs\-black\-out\-screens\fP
-+.INDENT 0.0
-+.INDENT 3.5
-+OS X only. Black out other displays when going fullscreen.
-+.UNINDENT
-+.UNINDENT
-+.INDENT 0.0
+.TP
+.B \fB\-\-keep\-open=<yes|no|always>\fP
+Do not terminate when playing or seeking beyond the end of the file, and
@@ -3583,7 +3582,7 @@ index 000000000..c411fc606
+.B \fB50%x50%\fP
+Forces the window width and height to half the screen width and
+height. Will show black borders to compensate for the video aspect
-+ration (with most VOs and without \fB\-\-no\-keepaspect\fP).
++ratio (with most VOs and without \fB\-\-no\-keepaspect\fP).
+.TP
+.B \fB50%+10+10\fP
+Sets the window to half the screen widths, and positions it 10
@@ -3737,7 +3736,7 @@ index 000000000..c411fc606
+ensure it does not cause security problems (e.g. make sure to use full
+paths if "." is in your path like on Windows). It also only works when
+playing video (i.e. not with \fB\-\-no\-video\fP but works with
-+\fB\-vo=null\fP).
++\fB\-\-vo=null\fP).
+.UNINDENT
+.UNINDENT
+.sp
@@ -5440,23 +5439,7 @@ index 000000000..c411fc606
+.SS OpenGL renderer options
+.sp
+The following video options are currently all specific to \fB\-\-vo=opengl\fP and
-+\fB\-vo=opengl\-cb\fP only, which are the only VOs that implement them.
-+.INDENT 0.0
-+.TP
-+.B \fB\-\-opengl\-dumb\-mode=<yes|no>\fP
-+This mode is extremely restricted, and will disable most extended OpenGL
-+features. This includes high quality scalers and custom shaders!
-+.sp
-+It is intended for hardware that does not support FBOs (including GLES,
-+which supports it insufficiently), or to get some more performance out of
-+bad or old hardware.
-+.sp
-+This mode is forced automatically if needed, and this option is mostly
-+useful for debugging. It\(aqs also enabled automatically if nothing uses
-+features which require FBOs.
-+.sp
-+This option might be silently removed in the future.
-+.UNINDENT
++\fB\-\-vo=opengl\-cb\fP only, which are the only VOs that implement them.
+.sp
+\fB\-\-scale=<filter>\fP
+.INDENT 0.0
@@ -6390,6 +6373,20 @@ index 000000000..c411fc606
+the renderer is going to wait for a while after rendering, instead of
+flipping GL front and backbuffers immediately (i.e. it doesn\(aqt call it
+in display\-sync mode).
++.TP
++.B \fB\-\-opengl\-dumb\-mode=<yes|no>\fP
++This mode is extremely restricted, and will disable most extended OpenGL
++features. This includes high quality scalers and custom shaders!
++.sp
++It is intended for hardware that does not support FBOs (including GLES,
++which supports it insufficiently), or to get some more performance out of
++bad or old hardware.
++.sp
++This mode is forced automatically if needed, and this option is mostly
++useful for debugging. It\(aqs also enabled automatically if nothing uses
++features which require FBOs.
++.sp
++This option might be silently removed in the future.
+.UNINDENT
+.SS Miscellaneous
+.INDENT 0.0
@@ -6663,13 +6660,6 @@ index 000000000..c411fc606
+.sp
+If the list has a trailing \(aq,\(aq, mpv will fall back on drivers not contained
+in the list.
-+.INDENT 0.0
-+.TP
-+.B \fB\-\-ao\-defaults=<driver1[:parameter1:parameter2:...],driver2,...>\fP
-+Set defaults for each driver.
-+.sp
-+Deprecated. No replacement.
-+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
@@ -7000,13 +6990,6 @@ index 000000000..c411fc606
+.sp
+If the list has a trailing \fB,\fP, mpv will fall back on drivers not contained
+in the list.
-+.INDENT 0.0
-+.TP
-+.B \fB\-\-vo\-defaults=<driver1[:parameter1:parameter2:...],driver2,...>\fP
-+Set defaults for each driver.
-+.sp
-+Deprecated. No replacement.
-+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
@@ -7606,9 +7589,9 @@ index 000000000..c411fc606
+.sp
+This is deprecated. Use \fB\-\-vo=opengl\fP instead, which is the default and
+provides the same functionality. The \fBrpi\fP VO will be removed in
-+mpv 0.22.0. Its functionality was folded into \-\-vo=opengl, which now uses
++mpv 0.23.0. Its functionality was folded into \-\-vo=opengl, which now uses
+RPI hardware decoding by treating it as a hardware overlay (without applying
-+GL filtering). Also to be changed in 0.22.0: the \-\-fs flag will be reset to
++GL filtering). Also to be changed in 0.23.0: the \-\-fs flag will be reset to
+"no" by default (like on the other platforms).
+.sp
+The following deprecated global options are supported by this video output:
@@ -9411,15 +9394,6 @@ index 000000000..c411fc606
+.UNINDENT
+.UNINDENT
+.TP
-+.B \fBvdpaurb\fP
-+This filter is deprecated. Use \fB\-\-hwdec=vdpau\-copy\fP instead.
-+.sp
-+VDPAU video read back. Works with \fB\-\-vo=vdpau\fP and \fB\-\-vo=opengl\fP only.
-+This filter will read back frames decoded by VDPAU so that other filters,
-+which are not normally compatible with VDPAU, can be used like normal.
-+This filter must be specified before \fBvdpaupp\fP in the filter chain if
-+\fBvdpaupp\fP is used.
-+.TP
+.B \fBd3d11vpp\fP
+Direct3D 11 video post processing. Currently requires D3D11 hardware
+decoding for use.
@@ -12002,10 +11976,9 @@ index 000000000..c411fc606
+Strictly speaking, option access via API (e.g. \fBmpv_set_option_string()\fP)
+has the same problem, and it\(aqs only a difference between CLI/API.
+.TP
-+.B \fBdemuxer\fP, \fBidle\fP, \fBlength\fP, \fBaudio\-samplerate\fP, \fBaudio\-channels\fP, \fBaudio\-format\fP, \fBfps\fP, \fBcache\fP, \fBplaylist\-pos\fP, \fBchapter\fP
-+These behave completely different as property, but are deprecated (newer
-+aliases which don\(aqt conflict have been added). After the deprecation period
-+they will be changed to the proper option behavior.
++.B \fBplaylist\-pos\fP, \fBchapter\fP
++These properties behave different from the deprecated options with the same
++names.
+.UNINDENT
+.SS Property Expansion
+.sp
@@ -12618,9 +12591,8 @@ index 000000000..c411fc606
+.sp
+When the player quits, all scripts will be asked to terminate. This happens via
+a \fBshutdown\fP event, which by default will make the event loop return. If your
-+script got into an endless loop, mpv will probably behave fine during playback
-+(unless the player is suspended, see \fBmp.suspend\fP), but it won\(aqt terminate
-+when quitting, because it\(aqs waiting on your script.
++script got into an endless loop, mpv will probably behave fine during playback,
++but it won\(aqt terminate when quitting, because it\(aqs waiting on your script.
+.sp
+Internally, the C code will call the Lua function \fBmp_event_loop\fP after
+loading a Lua script. This function is normally defined by the default prelude
@@ -13028,27 +13000,16 @@ index 000000000..c411fc606
+.INDENT 0.0
+.TP
+.B \fBmp.suspend()\fP
-+This function has been deprecated in mpv 0.21.0 (no replacement).
-+.sp
-+Suspend the mpv main loop. There is a long\-winded explanation of this in
-+the C API function \fBmpv_suspend()\fP\&. In short, this prevents the player
-+from displaying the next video frame, so that you don\(aqt get blocked when
-+trying to access the player.
-+.sp
-+Before mpv 0.17.0, this was automatically called by the event handler.
++This function has been deprecated in mpv 0.21.0 and does nothing starting
++with mpv 0.23.0 (no replacement).
+.TP
+.B \fBmp.resume()\fP
-+This function has been deprecated in mpv 0.21.0 (no replacement).
-+.sp
-+Undo one \fBmp.suspend()\fP call. \fBmp.suspend()\fP increments an internal
-+counter, and \fBmp.resume()\fP decrements it. When 0 is reached, the player
-+is actually resumed.
++This function has been deprecated in mpv 0.21.0 and does nothing starting
++with mpv 0.23.0 (no replacement).
+.TP
+.B \fBmp.resume_all()\fP
-+This function has been deprecated in mpv 0.21.0 (no replacement).
-+.sp
-+This resets the internal suspend counter and resumes the player. (It\(aqs
-+like calling \fBmp.resume()\fP until the player is actually resumed.)
++This function has been deprecated in mpv 0.21.0 and does nothing starting
++with mpv 0.23.0 (no replacement).
+.TP
+.B \fBmp.get_wakeup_pipe()\fP
+Calls \fBmpv_get_wakeup_pipe()\fP and returns the read end of the wakeup
@@ -13838,20 +13799,6 @@ index 000000000..c411fc606
+By default, most events are enabled, and there is not much use for this
+command.
+.TP
-+.B \fBsuspend\fP
-+Deprecated, will be removed completely in 0.21.0.
-+.sp
-+Suspend the mpv main loop. There is a long\-winded explanation of this in
-+the C API function \fBmpv_suspend()\fP\&. In short, this prevents the player
-+from displaying the next video frame, so that you don\(aqt get blocked when
-+trying to access the player.
-+.TP
-+.B \fBresume\fP
-+Deprecated, will be removed completely in 0.21.0.
-+.sp
-+Undo one \fBsuspend\fP call. \fBsuspend\fP increments an internal counter, and
-+\fBresume\fP decrements it. When 0 is reached, the player is actually resumed.
-+.TP
+.B \fBget_version\fP
+Returns the client API version the C API of the remote mpv instance
+provides.
diff --git a/pkg/mpv/patch/0004-ad_spdif-Fix-crash-when-spdif-muxer-is-not-available.patch b/pkg/mpv/patch/0004-ad_spdif-Fix-crash-when-spdif-muxer-is-not-available.patch
deleted file mode 100644
index ede82582..00000000
--- a/pkg/mpv/patch/0004-ad_spdif-Fix-crash-when-spdif-muxer-is-not-available.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 479c6bedadf9f4cce17c12a7fa1e43d39578704f Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 3 Jul 2016 17:41:45 -0700
-Subject: [PATCH] ad_spdif: Fix crash when spdif muxer is not available
-
-Currently, if init_filter fails after lavf_ctx is allocated, uninit is called
-which frees lavf_ctx, but doesn't clear the pointer in spdif_ctx. So, on the
-next call of decode_packet, it thinks it is already initialized and uses it,
-resulting in a crash on my system.
----
- audio/decode/ad_spdif.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c
-index 56e4a8102..71e24152f 100644
---- a/audio/decode/ad_spdif.c
-+++ b/audio/decode/ad_spdif.c
-@@ -71,6 +71,7 @@ static void uninit(struct dec_audio *da)
- av_freep(&lavf_ctx->pb->buffer);
- av_freep(&lavf_ctx->pb);
- avformat_free_context(lavf_ctx);
-+ spdif_ctx->lavf_ctx = NULL;
- }
- }
-
---
-2.11.0
-
diff --git a/pkg/mpv/rev b/pkg/mpv/rev
index 1e8b3149..7f8f011e 100644
--- a/pkg/mpv/rev
+++ b/pkg/mpv/rev
@@ -1 +1 @@
-6
+7
diff --git a/pkg/mpv/sources.txt b/pkg/mpv/sources.txt
index f5f6a108..47c8ae6e 100644
--- a/pkg/mpv/sources.txt
+++ b/pkg/mpv/sources.txt
@@ -201,7 +201,6 @@ video/filter/vf_sub.c
video/filter/vf_vapoursynth.c vapoursynth-core
video/filter/vf_vavpp.c vaapi
video/filter/vf_vdpaupp.c vdpau
-video/filter/vf_vdpaurb.c vdpau
video/filter/vf_yadif.c
video/out/aspect.c
video/out/bitmap_packer.c
@@ -224,6 +223,7 @@ video/out/opengl/context_wayland.c gl-wayland
video/out/opengl/context_w32.c gl-win32
video/out/opengl/context_x11.c gl-x11
video/out/opengl/context_x11egl.c egl-x11
+video/out/opengl/cuda_dynamic.c cuda-hwaccel
video/out/opengl/egl_helpers.c egl-helpers
video/out/opengl/formats.c gl
video/out/opengl/hwdec.c gl
diff --git a/pkg/mpv/src b/pkg/mpv/src
-Subproject 1d4273cfb52043c8165b85e9d7ac7bc14cb59cb
+Subproject 10a005df0c981050afc35184a42173bea7ea252