Switch to unified view

a/upqo/avtransport_qo.h b/upqo/avtransport_qo.h
...
...
123
123
124
    virtual void changed(const char *nm, UPnPClient::UPnPDirObject meta) {
124
    virtual void changed(const char *nm, UPnPClient::UPnPDirObject meta) {
125
        if (!strcmp(nm, "AVTransportURIMetaData")) {
125
        if (!strcmp(nm, "AVTransportURIMetaData")) {
126
            qDebug() << "AVT: Changed: " << nm << " (dirc): " << 
126
            qDebug() << "AVT: Changed: " << nm << " (dirc): " << 
127
                meta.dump().c_str();
127
                meta.dump().c_str();
128
            // Don't use this if no resources are set. XBMC does this
128
            // Don't use this if no resources are set. XBMC/Kodi does
129
            // for some reason.
129
            // this for some reason. Else we'd end-up with
130
            // resource-less unplayable entries in the
131
            // playlist. Scheduling a state update is not useful
132
            // either because the data will have the same
133
            // problem. Kodi only emits useful metadata when
134
            // explicitely told to switch tracks (not even at regular
135
            // track changes).
130
            if (!meta.m_resources.empty() &&
136
            if (!meta.m_resources.empty() &&
131
                (m_tpstate == UPnPClient::AVTransport::Playing ||
137
                (m_tpstate == UPnPClient::AVTransport::Playing ||
132
                 m_tpstate == UPnPClient::AVTransport::PausedPlayback) ) {
138
                 m_tpstate == UPnPClient::AVTransport::PausedPlayback) ) {
133
                emit currentMetadata(meta);
139
                emit currentMetadata(meta);
134
            }
140
            }
...
...
222
             m_tpstate == UPnPClient::AVTransport::PausedPlayback)) ) {
228
             m_tpstate == UPnPClient::AVTransport::PausedPlayback)) ) {
223
            qDebug() << "AVT: update: ext track change: cur [" << 
229
            qDebug() << "AVT: update: ext track change: cur [" << 
224
                m_cururi.c_str() << "] new [" <<                     
230
                m_cururi.c_str() << "] new [" <<                     
225
                info.trackuri.c_str() << "]";
231
                info.trackuri.c_str() << "]";
226
            setcururi(info.trackuri);
232
            setcururi(info.trackuri);
233
            if (!info.trackmeta.m_resources.empty()) {
234
                // Don't emit bogus meta which would unplayable
235
                // entries in the playlist. The only moment when Kodi
236
                // will emit usable metadata is when told to change
237
                // tracks. MediaInfo returns the same data.
238
                emit currentMetadata(info.trackmeta);
239
            }
227
            emit newTrackPlaying(u8s2qs(info.trackuri));
240
            emit newTrackPlaying(u8s2qs(info.trackuri));
228
        }
241
        }
229
        if (tinfo.tpstate == UPnPClient::AVTransport::Stopped && m_in_ending) {
242
        if (tinfo.tpstate == UPnPClient::AVTransport::Stopped && m_in_ending) {
230
            m_in_ending = false;
243
            m_in_ending = false;
231
            // qDebug() << "AVT: stoppedAtEOT";
244
            // qDebug() << "AVT: stoppedAtEOT";