[Android] VideoPlayerActivity onPause changes

Thomas Guillem thomas at gllm.fr
Wed Nov 26 21:29:16 CET 2014


On Wed, Nov 26, 2014, at 21:21, Edward Wang wrote:
> On Wed, Nov 26, 2014 at 11:02 AM, Paulo Vitor Magacho da Silva
> <pvmagacho at gmail.com> wrote:
> > Hi,
> >
> > In this class there is the following comment in onPause method.
> >
> > /*
> >  * Pausing here generates errors because the vout is constantly
> >  * trying to refresh itself every 80ms while the surface is not
> >  * accessible anymore.
> >  * To workaround that, we keep the last known position in the playlist
> >  * in savedIndexPosition to be able to restore it during onResume().
> >  */

Hum, I don't think this hack is needed anyore after android 2.3 when
using the new android_window vout.
I'll chech tomorrow.

> >
> > Instead of doing this, I propose another solution, where the surface is
> > detached and re-attached on resume (using surfaceCreate and surfaceDestroy
> > methods) and the pause method of LibVLC is used (instead of stop). It
> > wouldn't be necessary to save the current position and time anymore.
> >
> > There are also some minor changes needed in the VLC library to support this
> > - need to stop refreshing the surface and wait for a new one to be created
> > again.
> >
> > However, I would like to introduce it along with the multiple video
> > instances patch. At this point, it would take me a very long time to apply
> > this change to the current code.
> >
> > Can I submit both changes together ?
> 
> 
> I think that it would be cleaner to do them in two separate patches,
> since these are two separate functional changes.
> 
> Regards,
> Edward
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android


More information about the Android mailing list