Better logging of MediaPlayer failure reason.

Otherwise exception details are dropped on the floor, making it
hard to debug.

Bug: 22525550
Change-Id: I6ab9eb8461a23b9d9b8a0ea6dd1ae8ee2495dd01
This commit is contained in:
Jeff Sharkey
2015-07-20 09:38:02 -07:00
parent b3cf953345
commit 4fa85b7cad

View File

@@ -1017,16 +1017,14 @@ public class MediaPlayer implements SubtitleController.Listener
setDataSource(fd.getFileDescriptor(), fd.getStartOffset(), fd.getDeclaredLength());
}
return;
} catch (SecurityException ex) {
} catch (IOException ex) {
} catch (SecurityException | IOException ex) {
Log.w(TAG, "Couldn't open file on client side; trying server side: " + ex);
} finally {
if (fd != null) {
fd.close();
}
}
Log.d(TAG, "Couldn't open file on client side, trying server side");
setDataSource(uri.toString(), headers);
}