appunite / AndroidFFmpeg

[DEPRECATED] FFmpeg build for android random architectures with example jni
Apache License 2.0
1.07k stars 471 forks source link

Error with av_gettime() - fix video freezing #81

Open mavstuff opened 9 years ago

mavstuff commented 9 years ago

External function av_gettime() inside FFMpegLibrary returns current time erroneously trimmed to int32_t instead of int_64t due to incorrect linking issue. This causes video freezing after 20-30 minutes of playing or even faster.

To fix this, add

include <libavutil/time.h>

to the top of player.c file

Also add APP_CFLAGS := -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-label -Wno-unused-function inside Application.mk

There are few other functions that are linked from ffmpeg incorrectly, so I recommend adding headers for them too, and the above options will show those functions.

shalinashiyan commented 9 years ago

Tried this. Seems fixing the video freezing problem I had. Will do more testing. Thanks a lot for this. Earlier I was heading to a wrong path by checking if the wrap-around in int64_t and the subtraction between two time variables need some special care.

jacek-marchwicki commented 9 years ago

@shalinashiyan @mavstuff If you have some fixes please provide pull request so I will be able to review change and merge for others ;)

shalinashiyan commented 9 years ago

@jacek-marchwicki My code is quite messy as I still could not download everything from github so I ended up modifying player.c to suit my needs. As for video freezing, I think the method from mavstuff described above works. I just did those two additions and my video could flow for more than two hours (in the past, it was frozen around 20 minutes.

There is another timing issue in playing an RTMP link or an HLS link but I have fixed. I will explain it in a new issue to get your input.

jacek-marchwicki commented 9 years ago

@shalinashiyan what problems do you have while downloading from github? do you have problems with:

git submodule init
git submodule update

?

I recently changed repos for tropicssl and everything should work: travis can prove that ;)