diff options
author | Xerxes Rånby <[email protected]> | 2013-04-26 18:01:37 +0200 |
---|---|---|
committer | Xerxes Rånby <[email protected]> | 2013-05-10 09:39:48 +0200 |
commit | 6d802ec7431ee3d0c96aebf4c378887b0ecd82a0 (patch) | |
tree | 42522511c557016f5f3d4653765177185d9fa702 /src | |
parent | b621e895fdc0abfdfdc12cb55182d2223120d110 (diff) |
FFMPEGMediaPlayer: Use the Audio codec to decode audio. Also prevent double free of packet memory.
Signed-off-by: Xerxes Rånby <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c index bb54aea00..72cfc2c95 100644 --- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c +++ b/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGMediaPlayer.c @@ -595,10 +595,10 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex break; } if(HAS_FUNC(sp_avcodec_decode_audio4)) { - len1 = sp_avcodec_decode_audio4(pAV->pVCodecCtx, pAV->pAFrame, &frameFinished, &packet); + len1 = sp_avcodec_decode_audio4(pAV->pACodecCtx, pAV->pAFrame, &frameFinished, &packet); } else { #if 0 - len1 = sp_avcodec_decode_audio3(pAV->pVCodecCtx, int16_t *samples, int *frame_size_ptr, &frameFinished, &packet); + len1 = sp_avcodec_decode_audio3(pAV->pACodecCtx, int16_t *samples, int *frame_size_ptr, &frameFinished, &packet); #endif JoglCommon_throwNewRuntimeException(env, "Unimplemented: FFMPEGMediaPlayer sp_avcodec_decode_audio3 fallback"); return 0; @@ -690,7 +690,9 @@ JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGMediaPlayer_readNex } // Free the packet that was allocated by av_read_frame - sp_av_free_packet(&packet); + // This code cause a double free and have been commented out. + // TODO: check what release the packets memory. + // sp_av_free_packet(&packet); } return res; } |