Commit 22e966e9 authored by Edward Wang's avatar Edward Wang

Util: use -1 as default for consistency and add debug

parent 9f650102
...@@ -218,18 +218,21 @@ public class LibVlcUtil { ...@@ -218,18 +218,21 @@ public class LibVlcUtil {
} }
} }
float frequency = 0.f; float frequency = -1;
try { try {
FileReader fileReader = new FileReader("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"); FileReader fileReader = new FileReader("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq");
BufferedReader br = new BufferedReader(fileReader); BufferedReader br = new BufferedReader(fileReader);
String line = "";
try { try {
frequency = Float.parseFloat(br.readLine()) / 1000.f; /* Convert to MHz */ line = br.readLine();
frequency = Float.parseFloat(line) / 1000.f; /* Convert to MHz */
} catch(NumberFormatException e) { } catch(NumberFormatException e) {
/* keep default value of 0.f */ Log.w(TAG, "Could not parse maximum CPU frequency!");
Log.w(TAG, "Failed to parse: " + line);
} }
fileReader.close(); fileReader.close();
} catch(IOException ex) { } catch(IOException ex) {
Log.w(TAG, "Could not find maximum CPU frequency."); Log.w(TAG, "Could not find maximum CPU frequency!");
} }
errorMsg = null; errorMsg = null;
......
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