mozilla-b2g/gaia — pull request #2170 by doublec (2012-07-04 04:55:06+00:00)
Title: Some fixes to poster handling in the video app for mp4 videos

Two fixes contained here:

- Handle failure when loading posters
- Workaround to allow hardware decoding of video playback due to codec issues

On otoro devices with hardware decoding working, and similar hardware, if an mp4 video is present in the media directory the poster loading gives an error. This results in the video not appearing in the list. This patch handles the case of the poster being invalid.

The otoro driver for the h264 hardware decoder can only be instantiated once. When it is instantiated a second time it falls back to the software decoder. In the current video app the first instantiation occurs when getting the poster image. This results in actual playback of the video to always use the software decoder.

This patch clears out the testplayer's 'src' attribute so that the decoder is unloaded. This allows it to be re-instantiated when actual playback is selected so the hardware decoder can be used.