Ticket #11300: 0003-merged-devel-rtp-3a34be618f.patch

File 0003-merged-devel-rtp-3a34be618f.patch, 2.3 KB (added by gradhika.dn@…, 8 years ago)

merged devel/rtp 3a34be618f861c7

  • mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp

    From be14953ebbda86df6e1549b60870db089719808c Mon Sep 17 00:00:00 2001
    From: Daniel Thor Kristjansson <danielk@cuymedia.net>
    Date: Fri, 11 May 2012 15:00:32 -0400
    Subject: [PATCH 3/5] merged devel/rtp #3a34be618f
    
    ---
     .../libs/libmythtv/recorders/iptvstreamhandler.cpp |   28 ++++++++++++-------
     1 files changed, 18 insertions(+), 10 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp b/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp
    index 52b7823..188cf0e 100644
    a b void IPTVStreamHandler::run(void) 
    167167            "", 0);
    168168    }
    169169
     170    bool error = false;
    170171    for (uint i = 0; i < IPTV_SOCKET_COUNT; i++)
    171172    {
    172173        QUrl url = tuning.GetURL(i);
    void IPTVStreamHandler::run(void) 
    204205        m_sockets[i]->setSocketDescriptor(
    205206            fd, QAbstractSocket::UnconnectedState, QIODevice::ReadOnly);
    206207
    207         m_sockets[i]->bind(QHostAddress::Any, url.port());
    208 
    209208        QHostAddress dest_addr(tuning.GetURL(i).host());
    210209
     210        if (!m_sockets[i]->bind(dest_addr, url.port()))
     211        {
     212            LOG(VB_GENERAL, LOG_ERR, LOC + "Binding to port failed.");
     213            error = true;
     214        }
     215
    211216        if (dest_addr != QHostAddress::Any)
    212217        {
    213218            //m_sockets[i]->joinMulticastGroup(dest_addr); // needs Qt 4.8
    void IPTVStreamHandler::run(void) 
    229234        if (!url.userInfo().isEmpty())
    230235            m_sender[i] = QHostAddress(url.userInfo());
    231236    }
    232     if (m_use_rtp_streaming)
    233         m_buffer = new RTPPacketBuffer(tuning.GetBitrate(0));
    234     else
    235         m_buffer = new UDPPacketBuffer(tuning.GetBitrate(0));
    236     m_write_helper = new IPTVStreamHandlerWriteHelper(this);
    237     m_write_helper->Start();
    238237
    239     bool error = false;
    240     if (rtsp)
     238    if (!error)
     239    {
     240        if (m_use_rtp_streaming)
     241            m_buffer = new RTPPacketBuffer(tuning.GetBitrate(0));
     242        else
     243            m_buffer = new UDPPacketBuffer(tuning.GetBitrate(0));
     244        m_write_helper = new IPTVStreamHandlerWriteHelper(this);
     245        m_write_helper->Start();
     246    }
     247
     248    if (!error && rtsp)
    241249    {
    242250        // Start Streaming
    243251        if (!rtsp->Setup(m_sockets[0]->localPort(),