Commit 332ae4b5 authored by Christoph Pfister's avatar Christoph Pfister

vlc backend: emit playback status event in play()

parent 595ad46f
......@@ -140,6 +140,7 @@ void VlcMediaWidget::setDeinterlacing(bool deinterlacing)
void VlcMediaWidget::play(const MediaSource &source)
{
addPendingUpdates(PlaybackStatus);
QByteArray url = source.getUrl().toEncoded();
playingDvd = false;
......@@ -479,33 +480,37 @@ void VlcMediaWidget::mousePressEvent(QMouseEvent *event)
void VlcMediaWidget::vlcEvent(const libvlc_event_t *event)
{
// FIXME recheck
PendingUpdates pendingUpdatesToBeAdded = 0;
switch (event->type) {
case libvlc_MediaMetaChanged:
addPendingUpdates(Metadata);
return;
pendingUpdatesToBeAdded = Metadata;
break;
case libvlc_MediaPlayerEncounteredError:
addPendingUpdates(PlaybackStatus);
return;
pendingUpdatesToBeAdded = PlaybackStatus;
break;
case libvlc_MediaPlayerEndReached:
addPendingUpdates(PlaybackFinished | PlaybackStatus);
return;
pendingUpdatesToBeAdded = (PlaybackFinished | PlaybackStatus);
break;
case libvlc_MediaPlayerLengthChanged:
addPendingUpdates(CurrentTotalTime);
return;
pendingUpdatesToBeAdded = CurrentTotalTime;
break;
case libvlc_MediaPlayerSeekableChanged:
addPendingUpdates(Seekable);
return;
pendingUpdatesToBeAdded = Seekable;
break;
case libvlc_MediaPlayerStopped:
addPendingUpdates(PlaybackStatus);
return;
pendingUpdatesToBeAdded = PlaybackStatus;
break;
case libvlc_MediaPlayerTimeChanged:
addPendingUpdates(CurrentTotalTime);
return;
pendingUpdatesToBeAdded = CurrentTotalTime;
break;
}
Log("VlcMediaWidget::vlcEvent: unknown event type") << event->type;
if (pendingUpdatesToBeAdded != 0) {
addPendingUpdates(pendingUpdatesToBeAdded);
} else {
Log("VlcMediaWidget::vlcEvent: unknown event type") << event->type;
}
}
void VlcMediaWidget::vlcEventHandler(const libvlc_event_t *event, void *instance)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment