[haiku-commits] haiku: hrev50442 - src/add-ons/media/plugins/http_streamer

  • From: b.vitruvio@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 21 Jul 2016 20:48:37 +0200 (CEST)

hrev50442 adds 1 changeset to branch 'master'
old head: b4515980f3f8748c16c5b878fd5e11f337573430
new head: 4e793ddd87082e427fb7f72f837ff7cdd8a7d7c9
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=4e793ddd8708+%5Eb4515980f3f8

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

4e793ddd8708: http_streamer: Don't always use listener's IsRunning
  
  * We are not really handling http requests only.
  * Also move BHttpResult retrieve after casting BUrlRequest.

                                [ Dario Casalinuovo <b.vitruvio@xxxxxxxxx> ]

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

Revision:    hrev50442
Commit:      4e793ddd87082e427fb7f72f837ff7cdd8a7d7c9
URL:         http://cgit.haiku-os.org/haiku/commit/?id=4e793ddd8708
Author:      Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
Date:        Thu Jul 21 18:19:41 2016 UTC

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

1 file changed, 7 insertions(+), 2 deletions(-)
src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp | 9 +++++++--

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

diff --git a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp 
b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp
index dc4b2b4..7259af6 100644
--- a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp
+++ b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp
@@ -51,8 +51,9 @@ public:
                                delete request;
 
                        BHttpRequest* httpReq = 
dynamic_cast<BHttpRequest*>(request);
-                       const BHttpResult& httpRes = (const 
BHttpResult&)httpReq->Result();
                        if (httpReq != NULL) {
+                               const BHttpResult& httpRes
+                                       = (const BHttpResult&)httpReq->Result();
                                int32 status = httpRes.StatusCode();
                                if 
(BHttpRequest::IsClientErrorStatusCode(status)
                                                || 
BHttpRequest::IsServerErrorStatusCode(status)) {
@@ -192,7 +193,11 @@ HTTPMediaIO::Close()
 bool
 HTTPMediaIO::IsRunning() const
 {
-       return fListener->IsRunning();
+       BHttpRequest* httpReq = dynamic_cast<BHttpRequest*>(fReq);
+       if (httpReq != NULL)
+               return fListener->IsRunning();
+       else
+               return fReq->IsRunning();
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev50442 - src/add-ons/media/plugins/http_streamer - b . vitruvio