gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-92-g0d5cea8
Date: Sat, 19 Feb 2011 01:32:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  0d5cea87446e84e2e9f4bb4ddc4541f7d2824c71 (commit)
      from  c03ea7ec043e5ebe206d00cb1d936e403b48b006 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=0d5cea87446e84e2e9f4bb4ddc4541f7d2824c71


commit 0d5cea87446e84e2e9f4bb4ddc4541f7d2824c71
Author: Bastiaan Jacques <address@hidden>
Date:   Sat Feb 19 01:24:20 2011 +0100

    Don't busy the CPU trying to use a bad stream.

diff --git a/libmedia/gst/MediaParserGst.cpp b/libmedia/gst/MediaParserGst.cpp
index ce6441a..2778ae2 100644
--- a/libmedia/gst/MediaParserGst.cpp
+++ b/libmedia/gst/MediaParserGst.cpp
@@ -74,7 +74,7 @@ MediaParserGst::MediaParserGst(std::auto_ptr<IOChannel> 
stream)
     SimpleTimer timer;
 
     size_t counter = 0;
-    while (!probingConditionsMet(timer)) {
+    while (!probingConditionsMet(timer) && !_stream->eof() && !_stream->bad()) 
{
 
         if (!pushGstBuffer()) {
             ++counter;
@@ -141,7 +141,7 @@ MediaParserGst::parseNextChunk()
 
     // FIXME: our caller check for _parsingComplete prior
     //        to call parseNextChunk
-    if (_stream->eof()) {
+    if (_stream->eof() || _stream->bad()) {
         //log_debug (_("Stream EOF, emitting!"));
         _parsingComplete = true;
         return false;
@@ -174,24 +174,18 @@ MediaParserGst::pushGstBuffer()
 
     std::streamoff ret = _stream->read(GST_BUFFER_DATA(buffer), PUSHBUF_SIZE);
 
-    if (ret == 0) {
-        if (!_stream->eof()) {
-            log_error(_("MediaParserGst failed to read the stream, but did not 
"
-                      "reach EOF!"));
+    if (ret < PUSHBUF_SIZE) {
+        if (!_stream->eof() && !_stream->bad()) {
+            log_error(_("MediaParserGst failed to read the stream, but it did"
+                      " not reach EOF or enter a bad state."));
         } else {
             _parsingComplete = true;
         }
-        gst_buffer_unref(buffer);
-        return false;
-    }
 
-    if (ret < PUSHBUF_SIZE) {
-        if (!_stream->eof()) {
-            log_error(_("MediaParserGst failed to read the stream, but did not 
"
-                      "reach EOF!"));
-        } else {
-            _parsingComplete = true;
-        }       
+        if (!ret) {
+            gst_buffer_unref(buffer);
+            return false;
+        }
 
         GST_BUFFER_SIZE(buffer) = ret;
     }

-----------------------------------------------------------------------

Summary of changes:
 libmedia/gst/MediaParserGst.cpp |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]