[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r9570: Knowing when to stop reading t
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r9570: Knowing when to stop reading the file helps... |
Date: |
Thu, 07 Aug 2008 20:29:57 -0600 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9570
committer: address@hidden
branch nick: rtmp
timestamp: Thu 2008-08-07 20:29:57 -0600
message:
Knowing when to stop reading the file helps...
modified:
utilities/flvdumper.cpp
=== modified file 'utilities/flvdumper.cpp'
--- a/utilities/flvdumper.cpp 2008-08-08 02:16:19 +0000
+++ b/utilities/flvdumper.cpp 2008-08-08 02:29:57 +0000
@@ -192,15 +192,20 @@
ifs.read(reinterpret_cast<char *>(&previous),
sizeof(Flv::previous_size_t));
previous = ntohl(previous);
total -= sizeof(Flv::previous_size_t);
- log_debug("FLV Previous Tag Size was: %d", previous);
+ cerr << "FLV Previous Tag Size was: " << previous << endl;
ifs.read(reinterpret_cast<char *>(buf.reference()),
sizeof(Flv::flv_tag_t));
tag = flv.decodeTagHeader(&buf);
total -= sizeof(Flv::previous_size_t);
boost::uint32_t bodysize = flv.convert24(tag->bodysize);
- log_error("FLV Tag size is of %d.", bodysize);
+ cerr << "FLV Tag size is of " << bodysize << endl;
buf.resize(bodysize);
ifs.read(reinterpret_cast<char *>(buf.reference()), bodysize);
+ // Got to the end of the file
+ if (ifs.eof()) {
+ break;
+ }
+ total -= bodysize;
switch (tag->type) {
case Flv::TAG_AUDIO:
{
@@ -225,10 +230,7 @@
Element *metadata = flv.decodeMetaData(buf.reference(),
bodysize);
metadata->dump();
continue;
- };
-
-// Buffer data(bodysize);
-// ifs.read(reinterpret_cast<char *>(buf.reference()), bodysize);
+ };
};
} catch (std::exception& e) {
log_error("Reading %s: %s", filespec, e.what());
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r9570: Knowing when to stop reading the file helps...,
rob <=