Skip to content
Snippets Groups Projects
Commit 0331039a authored by Damian Minkov's avatar Damian Minkov
Browse files

Replaces json lib.

parent 60da7f9e
No related branches found
No related tags found
No related merge requests found
File deleted
File added
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
import org.jitsi.util.*; import org.jitsi.util.*;
import org.jitsi.util.event.*; import org.jitsi.util.event.*;
import org.jitsi.util.swing.*; import org.jitsi.util.swing.*;
import org.json.*; import org.json.simple.*;
import com.sun.media.util.*; import com.sun.media.util.*;
...@@ -906,29 +906,31 @@ public Map<MediaFormat, Byte> getDynamicPayloadTypePreferences() ...@@ -906,29 +906,31 @@ public Map<MediaFormat, Byte> getDynamicPayloadTypePreferences()
{ {
try try
{ {
JSONObject json = new JSONObject(source); JSONObject json = (JSONObject)JSONValue
.parseWithException(source);
String encoding String encoding
= json.getString( = (String)json.get(
MediaFormatImpl.ENCODING_PNAME); MediaFormatImpl.ENCODING_PNAME);
int clockRate long clockRate = (Long)json.get(
= json.getInt(MediaFormatImpl.CLOCK_RATE_PNAME); MediaFormatImpl.CLOCK_RATE_PNAME);
Map<String, String> fmtps Map<String, String> fmtps
= new HashMap<String, String>(); = new HashMap<String, String>();
if (json.has( if (json.containsKey(
MediaFormatImpl.FORMAT_PARAMETERS_PNAME)) MediaFormatImpl.FORMAT_PARAMETERS_PNAME))
{ {
JSONObject jsonFmtps JSONObject jsonFmtps
= json.getJSONObject( = (JSONObject)json.get(
MediaFormatImpl MediaFormatImpl
.FORMAT_PARAMETERS_PNAME); .FORMAT_PARAMETERS_PNAME);
Iterator<?> jsonFmtpsIter = jsonFmtps.keys(); Iterator<?> jsonFmtpsIter
= jsonFmtps.keySet().iterator();
while (jsonFmtpsIter.hasNext()) while (jsonFmtpsIter.hasNext())
{ {
String key String key
= jsonFmtpsIter.next().toString(); = jsonFmtpsIter.next().toString();
String value = jsonFmtps.getString(key); String value = (String)jsonFmtps.get(key);
fmtps.put(key, value); fmtps.put(key, value);
} }
...@@ -946,7 +948,7 @@ public Map<MediaFormat, Byte> getDynamicPayloadTypePreferences() ...@@ -946,7 +948,7 @@ public Map<MediaFormat, Byte> getDynamicPayloadTypePreferences()
dynamicPayloadTypePreference); dynamicPayloadTypePreference);
} }
} }
catch (JSONException jsone) catch (Throwable jsone)
{ {
logger.warn( logger.warn(
"Ignoring dynamic payload type preference" "Ignoring dynamic payload type preference"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment