turingmachine / omxplayer-sync

OMXPlayer-Sync facilitates synchronization of multiple OMXPlayer instances over the network in a master/slave fashion.
194 stars 70 forks source link

Fix issue: Video plays twice without the loop flag set #48

Closed mdmcclel closed 7 years ago

mdmcclel commented 7 years ago

Fixes #45.

Because of the conditions to break out of the main loop being checked after the video is played, execution will always loop once. There are several possible solutions:

1: Play the file after checking the loop conditions.  This has the
risk of possibly not playing the video at all, if the condtions are
not correct.

2: Set the "first play" flag to false after playing the file (before
checking the loop conditions).

Option 2 seems best, because it guarantees that the video file is always played at least once. Since the "first play" flag is only ever used here, it is actually not needed at all. the most elegant solution to this bug is simply to remove the flag.