Commit 255db4d2 authored by Sébastien Toque's avatar Sébastien Toque

decode title in VideoPlayerActivity

parent 3ddc2f0f
......@@ -22,6 +22,7 @@ package org.videolan.vlc.gui.video;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URLDecoder;
import org.videolan.vlc.EventManager;
import org.videolan.vlc.LibVLC;
......@@ -787,10 +788,13 @@ public class VideoPlayerActivity extends Activity {
if (lastTime > 0 && location.equals(lastLocation))
mLibVLC.setTime(lastTime);
title = new File(location).getName();
int dotIndex = title.lastIndexOf('.');
if (dotIndex != -1)
title = title.substring(0, dotIndex);
title = URLDecoder.decode(location);
if (title.startsWith("file:")) {
title = new File(title).getName();
int dotIndex = title.lastIndexOf('.');
if (dotIndex != -1)
title = title.substring(0, dotIndex);
}
mTitle.setText(title);
}
}
......
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