0

我在 Android 中有连接到服务器的 MP3 流服务。它使用媒体播放器。它还连接到服务器以从流中获取 XML 或 ID3 标签。在工作期间会发生一些错误。例如(主机地址替换为“主机”):

    07-16 17:40:22.535: I/System.out(2669): [socket][116] connection host(0)
07-16 17:40:26.871: W/MediaPlayer(2669): info/warning (701, 0)
07-16 17:40:26.872: I/MediaPlayer(2669): Info (701,0)
07-16 17:40:27.535: I/System.out(2669): [socket][117] connection host(0)
07-16 17:40:32.536: I/System.out(2669): [socket][118] connection host(0)
07-16 17:40:37.535: I/System.out(2669): [socket][119] connection host(0)
07-16 17:40:42.535: I/System.out(2669): [socket][120] connection host(0)
07-16 17:40:43.585: I/System.out(2669): [socket][121:51945] exception
07-16 17:40:47.535: I/System.out(2669): [socket][121] connection host(0)
07-16 17:40:48.583: I/System.out(2669): [socket][122:33875] exception
07-16 17:40:52.536: I/System.out(2669): [socket][122] connection host(0)
07-16 17:40:53.584: I/System.out(2669): [socket][123:41711] exception
07-16 17:40:57.734: I/InetAddress(2669): InetAddress_getaddrinfo>
07-16 17:40:57.734: I/InetAddress(2669): InetAddress_getaddrinfo<
07-16 17:40:57.735: I/System.out(2669): [socket][123] connection host(0)
07-16 17:40:58.135: E/MediaPlayer(2669): error (261, -1004)
07-16 17:40:58.136: E/MediaPlayer(2669): Error (261,-1004)
07-16 17:40:58.136: E/MediaPlayer(2669): stop called in state 0
07-16 17:40:58.136: E/MediaPlayer(2669): error (-38, 0)
07-16 17:40:58.159: W/MediaPlayer(2669): mediaplayer went away with unhandled events
07-16 17:40:58.584: I/System.out(2669): [socket][124:41579] exception
07-16 17:41:00.805: I/System.out(2669): [socket][/192.168.0.110:49622]
07-16 17:41:01.074: I/System.out(2669): close [socket][/0.0.0.0:49622]
07-16 17:41:01.584: I/System.out(2669): [socket][/192.168.0.110:45166]
07-16 17:41:01.923: D/dalvikvm(2669): GC_CONCURRENT freed 787K, 54% free 2923K/6343K, external 0K/0K, paused 4ms+4ms
07-16 17:41:01.937: I/System.out(2669): close [socket][/0.0.0.0:45166]
07-16 17:41:02.538: I/System.out(2669): [socket][124] connection host(0)
07-16 17:41:02.547: I/System.out(2669): [socket][/192.168.0.110:41556]
07-16 17:41:02.810: I/System.out(2669): close [socket][/0.0.0.0:41556]
07-16 17:41:03.584: I/System.out(2669): [socket][125:36225] exception
07-16 17:41:07.538: I/System.out(2669): [socket][125] connection host(0)
07-16 17:41:07.864: I/System.out(2669): [socket][/192.168.0.110:39862]
07-16 17:41:08.420: D/dalvikvm(2669): GC_CONCURRENT freed 855K, 55% free 2893K/6343K, external 0K/0K, paused 4ms+4ms
07-16 17:41:08.427: I/System.out(2669): close [socket][/0.0.0.0:39862]
07-16 17:41:08.584: I/System.out(2669): [socket][126:55248] exception

这部分是什么意思,尤其是 E/MediaPlayer(2669): error (261, -1004):

07-16 17:40:53.584: I/System.out(2669): [socket][123:41711] exception
07-16 17:40:57.734: I/InetAddress(2669): InetAddress_getaddrinfo>
07-16 17:40:57.734: I/InetAddress(2669): InetAddress_getaddrinfo<
07-16 17:40:57.735: I/System.out(2669): [socket][123] connection host(0)
07-16 17:40:58.135: E/MediaPlayer(2669): error (261, -1004)
07-16 17:40:58.136: E/MediaPlayer(2669): Error (261,-1004)
07-16 17:40:58.136: E/MediaPlayer(2669): stop called in state 0
07-16 17:40:58.136: E/MediaPlayer(2669): error (-38, 0)
07-16 17:40:58.159: W/MediaPlayer(2669): mediaplayer went away with unhandled events

?

4

1 回答 1

1

-1004表示MEDIA_ERROR_IO(文件或网络相关的操作错误,请参见此处)。

但通常完整的错误代码是(1,-1004). 261看起来很奇怪。您使用哪种 Android 设备?

于 2014-02-14T14:04:05.313 回答