Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Wait for seek to complete #1712

Merged
merged 8 commits into from Nov 30, 2023
Merged

fix: Wait for seek to complete #1712

merged 8 commits into from Nov 30, 2023

Conversation

Gustl22
Copy link
Collaborator

@Gustl22 Gustl22 commented Nov 26, 2023

Description

Wait for seek to finish by listening to the AudioEventType.seekComplete event.

  • need to validate if the tests are passing multiple times after each other
  • test what the Playbin GstState is after seeking

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, refactor:,
    docs:, chore:, test:, ci: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation and added dartdoc comments with ///, where necessary.
  • I have updated/added relevant examples in example.

Related Issues

@Gustl22 Gustl22 changed the title test: Add pump to receive last position event fix(linux): Wait for seek to complete Nov 28, 2023
@Gustl22 Gustl22 changed the title fix(linux): Wait for seek to complete fix: Wait for seek to complete Nov 29, 2023
@Gustl22 Gustl22 requested a review from spydon November 29, 2023 15:25
@Gustl22
Copy link
Collaborator Author

Gustl22 commented Nov 29, 2023

Is it ok to merge? I added quite a lot commits since your review @spydon :)

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, merge awaaay! 😄

@Gustl22 Gustl22 merged commit fd33b1d into main Nov 30, 2023
8 checks passed
@Gustl22 Gustl22 deleted the gustl22/fix-zero-event-linux branch November 30, 2023 07:35
@japostoles
Copy link

japostoles commented Feb 26, 2024

If the AudioPlayer is in a stopped state, the seek function will never complete, and the TimeoutException will fire 30 seconds later. ([ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: TimeoutException after 0:00:30.000000: Future not completed)

Any code after the seek will not be executed. From the perspective of a user of the library, the application will hang 30 seconds before registering an unhandled exception.

Sample code:

    var player = AudioPlayer();
    await player.setSource(DeviceFileSource(SomeAudioFile));
    await player.resume();
    sleep(Duration(seconds:1));
    await player.stop();
    print('-SEEK-');
    await player.seek(Duration(seconds:15));      // --- HANGS FOR DURATION OF TIMEOUT HERE
    print('-SEEK FINISH-');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants