Hi,

I'm currently working on an android video player. I am decoding audio
and video in a native thread and passing the decoded data back to my
application. I'm rendering a bitmap in a SurfaceView to display the
video and am using a  streaming AudioTrack to which I write data for
the audio.

When I decode and pass audio and video seperatly this works fine; I
can see the video playing smoothly and the audio is crystal clear. I
use a single C pthread to decode both audio and video, the SurfaceView
onDraw method for the bitmap drawing and a Java thread to play the
audio. Now, since the audio and video have to run in sync, I only
write the required frame audio data to the AudioTrack when needed.
This way, the audio always runs in sync. However, since I'm not
constantly writing audio data to the buffer to keep it in sync, there
is a constant cracking sound. This is probably caused because I'm not
constantly writing to the buffer.

Any ideas on how to solve this? I've thought of syncing the video to
the audio rather than the audio to the video, but I'm not sure what
kind of effect that'll give.

Many thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to