Commit e6703a9f authored by Geoffrey Métais's avatar Geoffrey Métais

LibVLC: Send LengthChanged events

parent 3e64b008
......@@ -44,6 +44,7 @@ static const libvlc_event_type_t mp_events[] = {
libvlc_MediaPlayerESSelected,
libvlc_MediaPlayerSeekableChanged,
libvlc_MediaPlayerPausableChanged,
libvlc_MediaPlayerLengthChanged,
-1,
};
......@@ -102,6 +103,9 @@ MediaPlayer_event_cb(vlcjni_object *p_obj, const libvlc_event_t *p_ev,
case libvlc_MediaPlayerPausableChanged:
p_java_event->arg1 = p_ev->u.media_player_pausable_changed.new_pausable;
break;
case libvlc_MediaPlayerLengthChanged:
p_java_event->arg1 = p_ev->u.media_player_length_changed.new_length;
break;
}
p_java_event->type = p_ev->type;
return true;
......
......@@ -62,7 +62,7 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
public static final int PausableChanged = 0x10e;
//public static final int TitleChanged = 0x10f;
//public static final int SnapshotTaken = 0x110;
//public static final int LengthChanged = 0x111;
public static final int LengthChanged = 0x111;
public static final int Vout = 0x112;
//public static final int ScrambledChanged = 0x113;
public static final int ESAdded = 0x114;
......@@ -87,6 +87,11 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
public long getTimeChanged() {
return arg1;
}
public long getLengthChanged() {
return arg1;
}
public float getPositionChanged() {
return argf1;
}
......@@ -1104,6 +1109,8 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
return new Event(eventType);
case Event.TimeChanged:
return new Event(eventType, arg1);
case Event.LengthChanged:
return new Event(eventType, arg1);
case Event.PositionChanged:
return new Event(eventType, argf1);
case Event.Vout:
......
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