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

[rar] add a callback class for unrarlib rather than calling into guilib #5000

Merged
merged 2 commits into from Jul 14, 2014

Conversation

jmarshallnz
Copy link
Contributor

We don't want to call into guilib directly from unrarlib, so this does the same as what we were doing (though with a 200ms delay) via a callback class.

@mkortstiege This should be pretty equivalent to what we already have in master. i.e. it is useful as a base from which to make further changes, such as increasing the time before display, or switching to busy dialog etc.

@mkortstiege
Copy link
Member

Yep, that will do. Thanks.

@jmarshallnz
Copy link
Contributor Author

Oh, needs testing ofc - I didn't do any at all :p

@mkortstiege
Copy link
Member

OK, will give it a chance around the weekend.

@mkortstiege
Copy link
Member

Looks good and works for me, thanks. Not sure if 200 ms is enough for slower hardware though or if we should make it adjustable to get an consistent UX. @popcornmix what's again the timings for rar stuff on the PI?

@popcornmix
Copy link
Member

Doesn't seem to calculate percentage correctly.
Tried two files and one pops up "-6%" (yes, negative) and the other "-31%" and the progress bar immediately disappears.

@jmarshallnz
Copy link
Contributor Author

My bet is it did it before this change as well? Can't see how the percentage is calculated any differently here at least?

@popcornmix
Copy link
Member

I was wrong about the negative, I think it's just a "-" used as a separator.

Without this PR the progress bar stays up for many seconds and updates from 0 to 100%.
With this PR the progress bar just flicks up for a fraction of a second.

Looks like this PR makes the rar extraction fail:

11:35:46 55235.421875 T:2901001296   ERROR: filerar::open failed to cache file The.Wolf.of.Wall.Street.2013.720p.BluRay.X264-AMIABLE.sub

Log without this PR: http://paste.ubuntu.com/7784423/
Log with this PR: http://paste.ubuntu.com/7784438/

@mkortstiege
Copy link
Member

That's weird. I have no such filerar::open issues here. All external (rarred) subs are detected properly.

}
bool progress(int progress, const char *text)
{
bool cancel(true);

This comment was marked as spam.

@jmarshallnz
Copy link
Contributor Author

Defaulting to cancel = false is probably the reason for the failures :)

@jmarshallnz
Copy link
Contributor Author

Updated - should be all good now. @popcornmix mind testing when you have a few?

@popcornmix
Copy link
Member

Fails again.
The logic for cancel is inverted.
You fail if:

    if (!m_progress(m_context, int(float(CurUnpWrite)/float(((Archive*)SrcFile)->NewLhd.FullUnpSize)*100), NULL))

But progress returns true if cancelled.

Tested with progress returning "!cancel" and it behaves as desired.

@jmarshallnz
Copy link
Contributor Author

Ah, I switched the wrong bool. I'll add some doxy about what it's supposed to do then make sure it does it. While paying attention this time :)

@jmarshallnz
Copy link
Contributor Author

@popcornmix, @mkortstiege updated - pretty confident this time (3rd, 4th times the charm?)

Jonathan Marshall added 2 commits July 14, 2014 14:21
@jmarshallnz
Copy link
Contributor Author

rebased. jenkins build this please

@mkortstiege
Copy link
Member

Works. Jenkins build failure is unrelated.. Android slave has problems as it seems.

@popcornmix
Copy link
Member

Looks okay to me.

jmarshallnz added a commit that referenced this pull request Jul 14, 2014
[rar] add a callback class for unrarlib rather than calling into guilib
@jmarshallnz jmarshallnz merged commit 551a08a into xbmc:master Jul 14, 2014
@jmarshallnz jmarshallnz deleted the hacky_rar_callback branch July 14, 2014 20:13
@MartijnKaijser MartijnKaijser added this to the Helix 14.0-alpha1 milestone Jul 14, 2014
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

4 participants