[Android] VideoPlayerActivity onPause changes

Edward Wang edward.c.wang at compdigitec.com
Wed Nov 26 21:21:53 CET 2014


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().
>  */
>
> 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


More information about the Android mailing list