android MediaExtractor MediaCodec seek

那年仲夏 提交于 2019-12-11 06:02:41

问题


Question again, guys.

I use MediaExtractor and MediaCodec to play MP4 file on android device. Everything works fine until I try to add Extractor.seekto().

If I just play mp3 file with my player,seeking functions well. However, when I try it with MP4 file, the video is not updated. I tried to debug the code, finding out that the mPlayerExtractor.getSampleTrackIndex() always returns 1 (Refer to the audio track).

But I do not know how to fix it.

I cannot put all my code here. So please give me some advise first. Thanks a lot.

Update: I can seek backward for both mp4 file and webm file. If I seek forward with webm file, The video starts to play after the same time of jumped time of the seeking operation. For mp4 file, it just never starts again.

来源:https://stackoverflow.com/questions/27122394/android-mediaextractor-mediacodec-seek

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!