From 2ce8e8fce35a12bda0be620ce0812518dab0f124 Mon Sep 17 00:00:00 2001 From: Makombo Date: Sat, 21 Jun 2014 23:56:49 -0400 Subject: [PATCH] Effectively exporting mediapl count Safe way to know how many items are in the media playlist. New getter retrieves p.count --- writer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/writer.go b/writer.go index cfcab9cd..563368d6 100644 --- a/writer.go +++ b/writer.go @@ -413,6 +413,11 @@ func (p *MediaPlaylist) DurationAsInt(yes bool) { p.durationAsInt = yes } +// Count tells us the number of items that are currently in the media playlist +func (p *MediaPlaylist) Count() (uint) { + return p.count +} + // Close sliding playlist and make them fixed. func (p *MediaPlaylist) Close() { if p.buf.Len() > 0 {