[vlc-commits] demux: adaptative: fix subsegment debug info
Francois Cartegnie
git at videolan.org
Tue May 12 18:28:58 CEST 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue May 12 16:17:28 2015 +0200| [62578f1b814885ebe71ec865c612ba797a920bf9] | committer: Francois Cartegnie
demux: adaptative: fix subsegment debug info
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=62578f1b814885ebe71ec865c612ba797a920bf9
---
modules/demux/adaptative/playlist/BaseRepresentation.cpp | 7 +++++--
modules/demux/adaptative/playlist/Segment.cpp | 14 +++++++++-----
modules/demux/adaptative/playlist/Segment.h | 4 ++--
3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/modules/demux/adaptative/playlist/BaseRepresentation.cpp b/modules/demux/adaptative/playlist/BaseRepresentation.cpp
index 0681dd5..186ed4f 100644
--- a/modules/demux/adaptative/playlist/BaseRepresentation.cpp
+++ b/modules/demux/adaptative/playlist/BaseRepresentation.cpp
@@ -63,8 +63,11 @@ std::vector<std::string> BaseRepresentation::toString(int indent) const
ret.push_back(text);
std::vector<ISegment *> list = getSegments();
std::vector<ISegment *>::const_iterator l;
- for(l = list.begin(); l < list.end(); l++)
- ret.push_back((*l)->toString(indent + 1));
+ for(l = list.begin(); l < list.end(); ++l)
+ {
+ std::vector<std::string> debug = (*l)->toString(indent + 1);
+ ret.insert(ret.end(), debug.begin(), debug.end());
+ }
return ret;
}
diff --git a/modules/demux/adaptative/playlist/Segment.cpp b/modules/demux/adaptative/playlist/Segment.cpp
index 0cd0b82..d4d1f52 100644
--- a/modules/demux/adaptative/playlist/Segment.cpp
+++ b/modules/demux/adaptative/playlist/Segment.cpp
@@ -88,13 +88,15 @@ size_t ISegment::getOffset() const
return startByte;
}
-std::string ISegment::toString(int indent) const
+std::vector<std::string> ISegment::toString(int indent) const
{
+ std::vector<std::string> out;
std::stringstream ss;
ss << std::string(indent, ' ') << debugName << " url=" << getUrlSegment().toString();
if(startByte!=endByte)
ss << " @" << startByte << ".." << endByte;
- return ss.str();
+ out.push_back(ss.str());
+ return out;
}
bool ISegment::contains(size_t byte) const
@@ -151,7 +153,7 @@ void Segment::setSourceUrl ( const std::string &url )
this->sourceUrl = url;
}
-std::string Segment::toString(int indent) const
+std::vector<std::string> Segment::toString(int indent) const
{
if (subsegments.empty())
{
@@ -159,11 +161,13 @@ std::string Segment::toString(int indent) const
}
else
{
- std::string ret;
+ std::vector<std::string> ret;
std::vector<SubSegment *>::const_iterator l;
+ ret.push_back(std::string(indent, ' ').append("Segment"));
for(l = subsegments.begin(); l != subsegments.end(); ++l)
{
- ret.append( (*l)->toString(indent + 1) );
+ std::vector<std::string> debug = (*l)->toString(indent + 1);
+ ret.insert(ret.end(), debug.begin(), debug.end());
}
return ret;
}
diff --git a/modules/demux/adaptative/playlist/Segment.h b/modules/demux/adaptative/playlist/Segment.h
index bd16ec2..bc5e90c 100644
--- a/modules/demux/adaptative/playlist/Segment.h
+++ b/modules/demux/adaptative/playlist/Segment.h
@@ -56,7 +56,7 @@ namespace adaptative
virtual size_t getOffset () const;
virtual std::vector<ISegment*> subSegments () = 0;
virtual void addSubSegment (SubSegment *) = 0;
- virtual std::string toString (int = 0) const;
+ virtual std::vector<std::string> toString (int = 0) const;
virtual bool contains (size_t byte) const;
int getClassId () const;
Property<mtime_t> startTime;
@@ -95,7 +95,7 @@ namespace adaptative
virtual Url getUrlSegment() const; /* impl */
virtual Chunk* toChunk(size_t, BaseRepresentation * = NULL);
virtual std::vector<ISegment*> subSegments();
- virtual std::string toString(int = 0) const;
+ virtual std::vector<std::string> toString(int = 0) const;
virtual void addSubSegment(SubSegment *);
static const int CLASSID_SEGMENT = 1;
More information about the vlc-commits
mailing list