Skip to content

Commit 32235de

Browse files
committed
HTSP Video: Possible workaround for periodic video hang
Returning RESULT_END_OF_INPUT when the extractor encounters a EOFException appears to reset things, we shouldn't be getting this EOFException as I understand it, so this is a hack at best
1 parent d274706 commit 32235de

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ repositories {
6868
}
6969

7070
dependencies {
71-
compile 'ie.macinnes.htsp:android-htsp:v0.0.1a13'
71+
compile 'ie.macinnes.htsp:android-htsp:v0.0.1a14'
7272
// Used for testing local HTSP lib builds
73-
// compile(name: 'library-release', ext: 'aar')
73+
// compile(name: 'library-debug', ext: 'aar')
7474
compile fileTree(include: ['*.jar'], dir: 'libs')
7575
// Used for testing local libvlc builds
7676
// compile(name: 'vlc-android-sdk-release', ext: 'aar')

app/src/main/java/ie/macinnes/tvheadend/player/HtspDataSource.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public int read(byte[] buffer, int offset, int readLength) throws IOException {
121121
Thread.sleep(250);
122122
} catch (InterruptedException e) {
123123
// Ignore.
124+
Log.w(TAG, "Caught InterruptedException, ignoring" ,e);
124125
}
125126
}
126127

app/src/main/java/ie/macinnes/tvheadend/player/HtspExtractor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ public int read(ExtractorInput input, PositionHolder seekPosition) throws IOExce
115115
handleMessage((HtspMessage) objectInput.readUnshared());
116116
}
117117
} catch (IOException e) {
118-
// Ignore?
119-
Log.w(TAG, "IOException", e);
118+
// TODO: This is a problem, and returning RESULT_END_OF_INPUT is a hack... I think?
119+
Log.w(TAG, "Caught IOException, returning RESULT_END_OF_INPUT", e);
120+
return RESULT_END_OF_INPUT;
120121
} catch (ClassNotFoundException e) {
121122
Log.w(TAG, "Class Not Found");
122123
} finally {

0 commit comments

Comments
 (0)