From b810687652507381115315d81c067f7a0a9ff8ac Mon Sep 17 00:00:00 2001 From: Vadim Getmanshchuk Date: Fri, 6 Mar 2020 21:52:22 -0800 Subject: [PATCH] fixed issue with #EXTINF without titles in #EXTINF tag, when comma `,` after segment duration immediately follows by `\n` the `title` is not getting populated and is not printed with `writeln!` The problem is created by the nom 5 conversion, where `take_until_either_and_consume!` macro was replaced with `is_not!` + `take!(1)`. However, in case when `opt!(take_until_either_and_consume!` is used, everything gets way too hairy. I couldn't to expressed that in a fairly elegant manner and instead fixed the data presentation, when a new manifest is produced. While storing `\n` in a form of `title` is a nice hack, I'm also convinced this is a better approach to data handling. --- src/playlist.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/playlist.rs b/src/playlist.rs index 509d7f9..163ddfa 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -622,6 +622,8 @@ impl MediaSegment { if let Some(ref v) = self.title { writeln!(w, "{}", v)?; + } else { + write!(w, "\n"); } writeln!(w, "{}", self.uri)