[phonon-gstreamer] Do not trigger paused state on 0 percentage
ClosedPublic

Authored by anthonyfieroni on Jul 20 2018, 7:52 AM.

Details

Reviewers
dvratil
sitter
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
R488:fca0714fd37b: Do not trigger paused state on 0 percentage
Summary

The problems presents in latest gstreamer, due to some changes i guess, how to reproduce

  1. set gstreamer as phonon backend
  2. start dragon and stream in
  3. click stop will result in temporary stopped state(about 1-2 sec) then stream starts again

CCBUG: 396256

Test Plan

It's not tested, i propagate that can be a fix.

  • dragon http://79.120.77.11:9091/
  • let play for a bit
  • action pause
  • remains paused. wait for at least 10 seconds
  • action resume
  • action stop
  • remains stopped. wait for at least 10 seconds
  • action resume

Diff Detail

Repository
R488 Phonon: GStreamer backend
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
anthonyfieroni created this revision.Jul 20 2018, 7:52 AM
Owners added a reviewer: Restricted Owners Package.Jul 20 2018, 7:52 AM
anthonyfieroni requested review of this revision.Jul 20 2018, 7:52 AM
anthonyfieroni edited the summary of this revision. (Show Details)

Any suggestions?

from IRC

[14:20] <dvratil> sitter: I've seen the review, but I currently don't have any means to test it

I myself am on an ancient gstreamer, so I can't really reproduce the original issue either. With the patch applied I still can stream though, so I suppose it's at least not regressing on older gstreamers.

  • dragon http://files.kde.org/akademy/2017/335-userfeedback.mp4
  • seek a bit
  • action pause
  • remains paused
  • resume
  • action stop
  • remains stopped

@dvratil maybe you could comment on the code in of itself? Could always land it and have it implicitly tested by people using kdesrc-build or whatever.

dvratil requested changes to this revision.Jul 24 2018, 7:09 PM

The change looks good to me codewise. I haven't tested it, but it does exactly what the documentation says. Just increase the timeout, please.

gstreamer/pipeline.cpp
255

Docs say that GstClockTime is measured in nanoseconds. I would propose a timeout of at least 10ms here since the operation is asynchronous and I doubt much is accomplished in 1 µs.

This revision now requires changes to proceed.Jul 24 2018, 7:09 PM
sitter edited the test plan for this revision. (Show Details)Jul 31 2018, 9:33 AM

I believe you the issue is real, all I was saying is that it still works on ancient libgstreamer as I have no recent one to test with :)

Anyway, I've updated the test plan with steps to do.

dvratil accepted this revision.Aug 4 2018, 10:45 AM
This revision is now accepted and ready to land.Aug 4 2018, 10:45 AM

I made some tests and the problem still persist, that's why i'm not still commit it.

anthonyfieroni retitled this revision from [phonon-gstreamer] Try to sync calls to gst_element_set_state to [phonon-gstreamer] Do not trigger paused state on 0 percentage.

That's change in 1.14 i think, so right after state goes to ready on stream gstreamer triggers signal sync-message::buffering with percentage 0 that's cb_buffering on other hand we change immediately state to paused in, so gstreamer starts buffering again and when goes to 100% we end up with playing state.

@sitter @dvratil we should make a new tag on gstreamer backend because now phonon users cannot stops online streams at all.

Well, I can't make a release if you don't land the commit?

gstreamer/pipeline.cpp
329

I think our code style is

if (percent == 0) {

I'll commit it as soon you accept.

gstreamer/pipeline.cpp
329

Yes, but it's related to other code style in the file.

sitter accepted this revision.Dec 10 2018, 1:36 PM

Well, dvratil is maintainer you don't need me to accept really, I'll just defer to him anyway :P

This revision was automatically updated to reflect the committed changes.

Is there a reason you didn't push that into the stable branch?

If you mean in 4.9 - no, i just not realize that.