diff --git a/README.md b/README.md index ce0fb7a9c..a6086b411 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ allprojects { } } dependencies { - implementation 'com.github.pedroSG94.RootEncoder:library:2.3.0' + implementation 'com.github.pedroSG94.RootEncoder:library:2.3.1' } ``` diff --git a/app/src/main/java/com/pedro/streamer/filestreamexample/RtmpFromFileActivity.java b/app/src/main/java/com/pedro/streamer/filestreamexample/RtmpFromFileActivity.java index 0cceeb949..c2d2c9c9a 100644 --- a/app/src/main/java/com/pedro/streamer/filestreamexample/RtmpFromFileActivity.java +++ b/app/src/main/java/com/pedro/streamer/filestreamexample/RtmpFromFileActivity.java @@ -160,7 +160,6 @@ public void onClick(View view) { try { if (!rtmpFromFile.isRecording()) { if (prepare()) { - rtmpFromFile.setLoopMode(true); button.setText(R.string.stop_button); rtmpFromFile.startStream(etUrl.getText().toString()); seekBar.setMax(Math.max((int) rtmpFromFile.getVideoDuration(), diff --git a/build.gradle b/build.gradle index 7bdbd51fc..488397819 100644 --- a/build.gradle +++ b/build.gradle @@ -4,8 +4,8 @@ apply plugin: 'org.jetbrains.dokka' buildscript { ext.kotlin_version = '1.9.10' ext.library_group = "com.github.pedroSG94" - ext.version_code = 230 - ext.version_name = "2.3.0" + ext.version_code = 231 + ext.version_name = "2.3.1" repositories { google() diff --git a/library/src/main/java/com/pedro/library/base/FromFileBase.java b/library/src/main/java/com/pedro/library/base/FromFileBase.java index b4832bcbf..a6749b47d 100644 --- a/library/src/main/java/com/pedro/library/base/FromFileBase.java +++ b/library/src/main/java/com/pedro/library/base/FromFileBase.java @@ -653,6 +653,7 @@ public void onVideoFormat(@NonNull MediaFormat mediaFormat) { recordController.setVideoFormat(mediaFormat, !audioEnabled); } }; + private final DecoderInterface decoderInterface = new DecoderInterface() { private int trackFinished = 0; diff --git a/library/src/main/java/com/pedro/library/util/AacMuxerRecordController.java b/library/src/main/java/com/pedro/library/util/AacMuxerRecordController.java index 948a118ce..b17ddfa94 100644 --- a/library/src/main/java/com/pedro/library/util/AacMuxerRecordController.java +++ b/library/src/main/java/com/pedro/library/util/AacMuxerRecordController.java @@ -84,9 +84,9 @@ public void recordVideo(ByteBuffer videoBuffer, MediaCodec.BufferInfo videoInfo) @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2) public void recordAudio(ByteBuffer audioBuffer, MediaCodec.BufferInfo audioInfo) { if (status == Status.RECORDING) { - Log.i(TAG, "s: " + sampleRate + ", c: " + channels); updateFormat(this.audioInfo, audioInfo); - write(audioBuffer, this.audioInfo); + //we need duplicate buffer to avoid problems with the buffer + write(audioBuffer.duplicate(), this.audioInfo); } }