summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-02-09 14:27:08 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-02-09 14:27:08 +0000
commit79ba79f36a9ea23e1cf72b0bba8794f5eedc4e7f (patch)
tree00a2943377a3e32a1ac031b94e50f3a0025626f7
parent6f2c618146814beeb289195c35508e7ac74fe47e (diff)
downloadgst-plugins-bad-79ba79f36a9ea23e1cf72b0bba8794f5eedc4e7f.tar.gz
gst-plugins-bad-79ba79f36a9ea23e1cf72b0bba8794f5eedc4e7f.tar.bz2
gst-plugins-bad-79ba79f36a9ea23e1cf72b0bba8794f5eedc4e7f.zip
ext/mplex/gstmplexibitstream.cc: gcc madness.
Original commit message from CVS: * ext/mplex/gstmplexibitstream.cc: gcc madness.
-rw-r--r--ChangeLog5
-rw-r--r--ext/mplex/gstmplexibitstream.cc26
2 files changed, 19 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d83730c..d0e88d2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-02-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+ * ext/mplex/gstmplexibitstream.cc:
+ gcc madness.
+
+2005-02-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
* ext/ogg/gstogmparse.c:
* gst/debug/gstnavigationtest.c:
Die, thou faulty symbol pollutors (non-static parent_class).
diff --git a/ext/mplex/gstmplexibitstream.cc b/ext/mplex/gstmplexibitstream.cc
index 28c0ff0b..0f517703 100644
--- a/ext/mplex/gstmplexibitstream.cc
+++ b/ext/mplex/gstmplexibitstream.cc
@@ -66,21 +66,20 @@ GstMplexIBitStream::~GstMplexIBitStream (void)
* Read data.
*/
-size_t GstMplexIBitStream::ReadStreamBytes (uint8_t * buf, size_t size)
+size_t
+GstMplexIBitStream::ReadStreamBytes (uint8_t * buf, size_t size)
{
- guint8 *
- data;
- guint
- read;
+ guint8 *data;
+
+ guint read = 0;
if (eos)
return 0;
while (!eos && (read = gst_bytestream_peek_bytes (bs, &data, size)) != size) {
- GstEvent *
- event;
- guint
- pending;
+ GstEvent *event;
+
+ guint pending;
gst_bytestream_get_status (bs, &pending, &event);
if (event) {
@@ -95,8 +94,10 @@ size_t GstMplexIBitStream::ReadStreamBytes (uint8_t * buf, size_t size)
}
}
- memcpy (buf, data, read);
- gst_bytestream_flush_fast (bs, read);
+ if (read > 0) {
+ memcpy (buf, data, read);
+ gst_bytestream_flush_fast (bs, read);
+ }
return read;
}
@@ -105,7 +106,8 @@ size_t GstMplexIBitStream::ReadStreamBytes (uint8_t * buf, size_t size)
* Are we at EOS?
*/
-bool GstMplexIBitStream::EndOfStream (void)
+bool
+GstMplexIBitStream::EndOfStream (void)
{
return eos;
}