Code Monkey home page Code Monkey logo

Comments (8)

jacek-marchwicki avatar jacek-marchwicki commented on May 18, 2024

Yes - this is known issue. But usually it is with first ~1second. What device are you using?

from androidffmpeg.

androisgabriel avatar androisgabriel commented on May 18, 2024

I'm running a Samsung Galaxy S3. And it's not the first second, it's actually 10-13 seconds. And happens on pause/resume every time, with no exception

from androidffmpeg.

androisgabriel avatar androisgabriel commented on May 18, 2024

Happens on HTC too. So I don't think it's device specific. The problem is that on resume/play, the audio jumps at a future position and the video is trying to catch up with audio, that's why it plays so fast.

from androidffmpeg.

jacek-marchwicki avatar jacek-marchwicki commented on May 18, 2024

I know this issue - it's problem with synchronization after resuming/starting. But I do not know when I will have time to fix this issue. If you can give me a patch for this it would be splendidly.

from androidffmpeg.

androisgabriel avatar androisgabriel commented on May 18, 2024

Hey Jacek, I've been trying to fix this issue but with no luck so far. Could you please give me some hints or something on how to fix it? I would really appreciate it.
Thanks

from androidffmpeg.

jacek-marchwicki avatar jacek-marchwicki commented on May 18, 2024

You probably have to look why frames are passed to early in: jni_player_render_frame()

it could be problem with:

int64_t current_time = av_gettime();
int64_t time_diff = current_time - player->audio_write_time;
double pts_time_diff_d = elem->time - player->audio_clock;
int64_t sleep_time = (int64_t) (pts_time_diff_d * 1000.0)
        - (int64_t) (time_diff / 1000L);

or

player->audio_write_time, player->audio_clock

or it could be problem with: jni_player_resume
where calling:

player->audio_resume_time = av_gettime();
if (player->audio_write_time < player->audio_pause_time) {
    player->audio_write_time = player->audio_resume_time;
} else if (player->audio_write_time < player->audio_resume_time) {
    player->audio_write_time += player->audio_resume_time
            - player->audio_pause_time;
}

from androidffmpeg.

jacek-marchwicki avatar jacek-marchwicki commented on May 18, 2024

There are some encantments in #13 that can simplify resolving this issue because synchronization there is done via timer clock. Unfortunately this task is not done.

from androidffmpeg.

jacek-marchwicki avatar jacek-marchwicki commented on May 18, 2024

Fixed in https://review.appunite.com/#/c/3807/

from androidffmpeg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.