Commit 142154e3 authored by Thomas Guillem's avatar Thomas Guillem

LibVLC: Media: don't override options set by the LibVLC user.

parent 921090fd
......@@ -417,6 +417,9 @@ public class Media extends VLCObject<Media.Event> {
private int mState = -1;
private int mType = -1;
private boolean mCodecOptionSet = false;
private boolean mFileCachingSet = false;
private boolean mNetworkCachingSet = false;
/**
* Create a Media from libVLC and a local path starting with '/'.
......@@ -757,8 +760,10 @@ public class Media extends VLCObject<Media.Event> {
* for 320x170 H.264, a few packets less on higher resolutions.
* On Nexus S, the decoder latency seems to be about 7 packets.
*/
addOption(":file-caching=1500");
addOption(":network-caching=1500");
if (!mFileCachingSet)
addOption(":file-caching=1500");
if (!mNetworkCachingSet)
addOption(":network-caching=1500");
final StringBuilder sb = new StringBuilder(":codec=");
if (decoder == HWDecoderUtil.Decoder.MEDIACODEC || decoder == HWDecoderUtil.Decoder.ALL)
......@@ -797,6 +802,10 @@ public class Media extends VLCObject<Media.Event> {
synchronized (this) {
if (!mCodecOptionSet && option.startsWith(":codec="))
mCodecOptionSet = true;
if (!mNetworkCachingSet && option.startsWith(":network-caching="))
mNetworkCachingSet = true;
if (!mFileCachingSet && option.startsWith(":file-caching="))
mFileCachingSet = true;
}
nativeAddOption(option);
}
......
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