mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 13:31:00 +00:00
closedcaption/{scc,mcc}parse: Allow an optional UTF-8 BOM at the beginning
Some software is apparently writing an UTF-8 BOM at the beinning of the file.
This commit is contained in:
parent
a4a0a669bd
commit
36bcd54306
2 changed files with 6 additions and 1 deletions
|
@ -129,6 +129,7 @@ where
|
|||
I::Error: ParseError<I::Token, I::Range, I::Position>,
|
||||
{
|
||||
(
|
||||
optional(range(&[0xEFu8, 0xBBu8, 0xBFu8][..])),
|
||||
range(b"File Format=MacCaption_MCC V".as_ref()),
|
||||
choice!(range(b"1.0".as_ref()), range(b"2.0".as_ref())),
|
||||
end_of_line(),
|
||||
|
|
|
@ -120,7 +120,11 @@ where
|
|||
I: RangeStream<Token = u8, Range = &'a [u8]>,
|
||||
I::Error: ParseError<I::Token, I::Range, I::Position>,
|
||||
{
|
||||
(range(b"Scenarist_SCC V1.0".as_ref()), end_of_line())
|
||||
(
|
||||
optional(range(&[0xEFu8, 0xBBu8, 0xBFu8][..])),
|
||||
range(b"Scenarist_SCC V1.0".as_ref()),
|
||||
end_of_line(),
|
||||
)
|
||||
.map(|_| SccLine::Header)
|
||||
.message("while parsing header")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue