Skip to content

Commit 98d0900

Browse files
committed
Strip out warnings from ffprobe execution
On the Android emulator used on Travis-CI there is a warning emitted from ffprobe when it outputs json, namely: WARNING: linker: /data/data/protect.videoeditor/files/ffprobe: unused DT entry: type 0x6ffffffe arg 0x22c0 WARNING: linker: /data/data/protect.videoeditor/files/ffprobe: unused DT entry: type 0x6fffffff arg 0x3 Skip past any such warnings to the json payload.
1 parent 51b35d2 commit 98d0900

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/main/java/protect/videotranscoder/FFmpegUtil.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ public static void probeGetOutput(@NonNull final String [] command,
154154
@Override
155155
public void onSuccess(String message)
156156
{
157+
// On some systems some warnings are emitted right before the json, such as:
158+
// WARNING: linker: /data/data/protect.videoeditor/files/ffprobe: unused DT entry: type 0x6ffffffe arg 0x22c0
159+
// Skip past this to the start of the json, if any exists.
160+
161+
int jsonStartIndex = message.indexOf('{');
162+
if(jsonStartIndex != -1)
163+
{
164+
message = message.substring(jsonStartIndex);
165+
}
166+
157167
resultHandler.onResult(message);
158168
}
159169

0 commit comments

Comments
 (0)