Skip to content

Commit 0831372

Browse files
author
ehmm
committed
trim video on transcoding
1 parent e066c00 commit 0831372

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/main/java/net/ypresto/androidtranscoder/engine/VideoTrackTranscoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private int drainEncoder(long timeoutUs) {
214214
throw new RuntimeException("Could not determine actual output format.");
215215
}
216216

217-
if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
217+
if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0 || mWrittenPresentationTimeUs == 3 * 60 * 1000) {
218218
mIsEncoderEOS = true;
219219
mBufferInfo.set(0, 0, 0, mBufferInfo.flags);
220220
}

0 commit comments

Comments
 (0)