Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseRequest请求一直报错,请大佬看看 #17

Open
HuShanquan3 opened this issue May 22, 2022 · 0 comments
Open

parseRequest请求一直报错,请大佬看看 #17

HuShanquan3 opened this issue May 22, 2022 · 0 comments

Comments

@HuShanquan3
Copy link

HuShanquan3 commented May 22, 2022

IJKpalyer播放器播放时,一直有错误打印,就是这个HttpRequest.parseRequest,明明请求失败了,但是却又有响应M3U8SegRespons,很奇怪

E/libOpenSLES: frameworks/wilhelm/src/android/AudioPlayer_to_android.cpp:1197: pthread_mutex_lock_timeout_np returned 110
I/M3U8CacheTask: startDownloadSegTask index=15, url=http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/bh2MVpba.ts
I/IJKMEDIA: Opening 'http://127.0.0.1:43252/aHR0cDovL2Nkbi5tYWludnlvdS5jb20vMjAyMjAxMTcvSFFDVmNmVWYvaW5kZXgubTN1OCZqZWZmbW9ueV9zZWcmaHR0cDovL2Nkbi5tYWludnlvdS5jb20vMjAyMjAxMTcvSFFDVmNmVWYvODAwa2IvaGxzL0llM29nald3LnRzJmplZmZtb255X3NlZyYvNjVkNWJlYzU1NGMyNjRjY2UwMDMzMzYxZGI4MTExMWYvMS50cyZqZWZmbW9ueV9zZWcmdW5rbm93bg' for reading
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 1
W/System.err: java.net.SocketException: Can't read inputStream
W/System.err: at com.owen.tv91.player.videocache.socket.request.HttpRequest.parseRequest(HttpRequest.java:69)
W/System.err: at com.owen.tv91.player.videocache.socket.SocketProcessTask.run(SocketProcessTask.java:43)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
W/SocketProcessTask: socket request failed, exception=java.net.SocketException: Can't read inputStream
I/SocketProcessTask: finally Socket solve count = 1
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 131073
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 131074
I/SocketProcessTask: sRequestCountAtomic : 2
D/SocketProcessTask: request url=http://cdn.hainvyou.com/20220117/HQCVcfUf/index.m3u8&jeffmony_seg&http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/Ie3ogjWw.ts&jeffmony_seg&/65d5bec554c264cce0033361db81111f/1.ts&jeffmony_seg&unknown
http://cdn.hainvyou.com/20220117/HQCVcfUf/index.m3u8
http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/Ie3ogjWw.ts
/65d5bec554c264cce0033361db81111f/1.ts
unknown
I/M3U8SegResponse: SegFilePath=/storage/emulated/0/Android/data/com.owen.tv91/files/Video/jeffmony/65d5bec554c264cce0033361db81111f/1.ts
I/M3U8SegResponse: index=1, parentUrl=http://cdn.hainvyou.com/20220117/HQCVcfUf/index.m3u8, segUrl=http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/Ie3ogjWw.ts
I/M3U8CacheTask: startDownloadSegTask index=16, url=http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/eT4tl0JI.ts
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 2
D/M3U8SegResponse: FileLength=600472, segLength=0, FilePath=/storage/emulated/0/Android/data/com.owen.tv91/files/Video/jeffmony/65d5bec554c264cce0033361db81111f/1.ts
D/M3U8SegResponse: Send M3U8 ts file end, this=com.owen.tv91.player.videocache.socket.response.M3U8SegResponse@15185347
I/M3U8CacheTask: startDownloadSegTask index=17, url=http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/j8N36jCp.ts
W/System.err: java.net.SocketException: Can't read inputStream
at com.owen.tv91.player.videocache.socket.request.HttpRequest.parseRequest(HttpRequest.java:69)
at com.owen.tv91.player.videocache.socket.SocketProcessTask.run(SocketProcessTask.java:43)
W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
I/IJKMEDIA: Opening 'http://127.0.0.1:43252/aHR0cDovL2Nkbi5tYWludnlvdS5jb20vMjAyMjAxMTcvSFFDVmNmVWYvaW5kZXgubTN1OCZqZWZmbW9ueV9zZWcmaHR0cDovL2Nkbi5tYWludnlvdS5jb20vMjAyMjAxMTcvSFFDVmNmVWYvODAwa2IvaGxzL3k2UERrYVNhLnRzJmplZmZtb255X3NlZyYvNjVkNWJlYzU1NGMyNjRjY2UwMDMzMzYxZGI4MTExMWYvMi50cyZqZWZmbW9ueV9zZWcmdW5rbm93bg' for reading
W/System.err: at java.lang.Thread.run(Thread.java:818)
W/SocketProcessTask: socket request failed, exception=java.net.SocketException: Can't read inputStream
I/SocketProcessTask: finally Socket solve count = 1
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 1
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 131073
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 131074
D/IJKMEDIA: FFP_MSG_VIDEO_SIZE_CHANGED: 1280, 720
D/IJKMEDIA: SDL_VoutFFmpeg_CreateOverlay(w=1280, h=720, fmt=RV32(0x32335652, dp=0xb06c8da0)
I/SocketProcessTask: sRequestCountAtomic : 2
D/SocketProcessTask: request url=http://cdn.hainvyou.com/20220117/HQCVcfUf/index.m3u8&jeffmony_seg&http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/y6PDkaSa.ts&jeffmony_seg&/65d5bec554c264cce0033361db81111f/2.ts&jeffmony_seg&unknown
D/SocketProcessTask: http://cdn.hainvyou.com/20220117/HQCVcfUf/index.m3u8
http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/y6PDkaSa.ts
/65d5bec554c264cce0033361db81111f/2.ts
unknown
I/M3U8SegResponse: SegFilePath=/storage/emulated/0/Android/data/com.owen.tv91/files/Video/jeffmony/65d5bec554c264cce0033361db81111f/2.ts
index=2, parentUrl=http://cdn.hainvyou.com/20220117/HQCVcfUf/index.m3u8, segUrl=http://cdn.hainvyou.com/20220117/HQCVcfUf/800kb/hls/y6PDkaSa.ts
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 2
D/M3U8SegResponse: FileLength=281248, segLength=0, FilePath=/storage/emulated/0/Android/data/com.owen.tv91/files/Video/jeffmony/65d5bec554c264cce0033361db81111f/2.ts
D/M3U8SegResponse: Send M3U8 ts file end, this=com.owen.tv91.player.videocache.socket.response.M3U8SegResponse@39b1d540
D/IJKMEDIA: ANativeWindow_setBuffersGeometry: w=580, h=326, f=�(0x1) => w=1280, h=720, f=RV32(0x32335652)
D/IJKMEDIA: FFP_MSG_VIDEO_SIZE_CHANGED: 1280, 720
W/System.err: java.net.SocketException: Can't read inputStream
I/IJKMEDIA: Opening 'http://127.0.0.1:43252/aHR0cDovL2Nkbi5tYWludnlvdS5jb20vMjAyMjAxMTcvSFFDVmNmVWYvaW5kZXgubTN1OCZqZWZmbW9ueV9zZWcmaHR0cDovL2Nkbi5tYWludnlvdS5jb20vMjAyMjAxMTcvSFFDVmNmVWYvODAwa2IvaGxzLzBhemhGc3ZlLnRzJmplZmZtb255X3NlZyYvNjVkNWJlYzU1NGMyNjRjY2UwMDMzMzYxZGI4MTExMWYvMy50cyZqZWZmbW9ueV9zZWcmdW5rbm93bg' for reading
W/System.err: at com.owen.tv91.player.videocache.socket.request.HttpRequest.parseRequest(HttpRequest.java:69)
at com.owen.tv91.player.videocache.socket.SocketProcessTask.run(SocketProcessTask.java:43)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
W/SocketProcessTask: socket request failed, exception=java.net.SocketException: Can't read inputStream
I/SocketProcessTask: finally Socket solve count = 1

看了一下源码,不知道是不是和这while循环有关,正常流程是不是也要关闭socket
public void run() {
try {
//....................................
while(!mSocket.isClosed()) { // 修改方式1:这里改成if
request.parseRequest();
BaseResponse response;
//....................................
if (TextUtils.equals(ProxyCacheUtils.M3U8, videoTypeInfo)) {
response = new M3U8Response(request, videoUrl, headers, currentTime);
} else if (TextUtils.equals(ProxyCacheUtils.NON_M3U8, videoTypeInfo)) {
response = new Mp4Response(request, videoUrl, headers, currentTime);
} else {
//无法从已知的信息判定视频信息,需要重新请求
//....................................
} else if (url.contains(ProxyCacheUtils.SEG_PROXY_SPLIT_STR)) {
//说明是M3U8 ts格式的文件
//....................................
} else {
throw new VideoCacheException("Local Socket Error url");
}
/*******************************************************************************
ProxyCacheUtils.close(mSocket); // 修改方式2:这里响应之后得关闭该socket
********************************************************************************/
}

	} catch (Exception e) {
		e.printStackTrace();
		LogUtils.w(TAG,"socket request failed, exception=" + e);
	} finally {
		ProxyCacheUtils.close(outputStream);
		ProxyCacheUtils.close(inputStream);
		ProxyCacheUtils.close(mSocket);
		int count = sRequestCountAtomic.decrementAndGet();
		LogUtils.i(TAG, "finally Socket solve count = " + count);
	}
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant