[mythtv-users] IPTV - MPEG-TS stream failed to receive bytes

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Jun 15 10:22:59 UTC 2016


On Wed, 15 Jun 2016 00:59:36 -0400, you wrote:

>Thanks for hanging in there with me Stephen. I have actually been trying to
>hack something together, but my c++ is rusty and I'm not too familiar with
>the Qt framework... My latest attempt was to try and get the http status
>and redefine the url variable if the status code is 302.
>
>From mythtv/mythtv/libs/libmythtv/recorders/httptsstreamhandler.cpp
>starting at line 133
>
>Original:
>
>    // the HTTP request
>    m_replylock.lock();
>    m_reply = m_mgr.get(QNetworkRequest(url));
>    m_replylock.unlock();
>
>Changes:
>
> // the HTTP request
>    m_replylock.lock();
>    m_reply = m_mgr.get(QNetworkRequest(url));
>    m_replyStatus =
>m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
>    if (m_replyStatus == 302)
>        {
>            const QUrl url =
>m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
>        }
>    m_replylock.unlock();
>
>
>The code compiles, but it is still not using the redirected URL as far as I
>can tell. I am going to keep hacking away tomorrow, but if you have any
>suggestions I am open to them.
>
>Thanks,
>Dave

I do not know QT at all, and my C++ is also quite rusty.  But when I
had a look at that code and Googled QNetworkRequest, the thought I had
was to make the original query have the
QNetworkRequest::FollowRedirectsAttribute flag, so that it would
automatically follow any redirects without any further intervention.


More information about the mythtv-users mailing list