turingmachine / omxplayer-sync

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

Single file played twice when no loop selected #45

Closed MrBeOkay closed 8 years ago

MrBeOkay commented 8 years ago

If I try to play the test file only once (without the -u) it still plays the file twice. I think this is due to the order of the commands in the While True loop of line 161 to 166

The play command is done first and then the check for first run is done, and then the 'first_run' variable is chanced. Second time around the play is done again before the check, so it ends up playing the file twice.

I think line 162 : self.play_file(self.playlist[self.playlist_index]) should instead be on line 165, after the If 'first_run' check statement.

Just my 2 cts

Best regards, Arjan

turingmachine commented 8 years ago

Pull requests are welcome :)

mdmcclel commented 8 years ago

Hi! I am currently using this project for a Halloween prop, and hit this bug.

Because the main loop is set up like a do-while, the video will always be played at least once. The flag which makes sure the video is played once is redundant and is actually causing the video to be played twice. Removing this flag should fix the issue.

I made a change request to that effect.

Thanks, --Matt

magdesign commented 8 years ago

You are totally right. File loops two times. Thanks for your pull request, will test it shortly and if everything works merge it!