diff options
author | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:33 +0000 |
---|---|---|
committer | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:33 +0000 |
commit | e4422c244d5187c7c7b3e9a2d986f041a3fc8a7a (patch) | |
tree | 466c2f04bef7120a021627ffda6f4db994802fda /bin/psycamp | |
parent | 4985f55c48c2ebd6d3409591ccd3ddbcf57981d4 (diff) | |
download | perlpsyc-e4422c244d5187c7c7b3e9a2d986f041a3fc8a7a.tar.gz perlpsyc-e4422c244d5187c7c7b3e9a2d986f041a3fc8a7a.zip |
psycamp: when media file is corrupt, mplayer may get stuck
Diffstat (limited to 'bin/psycamp')
-rwxr-xr-x | bin/psycamp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/bin/psycamp b/bin/psycamp index d73403b..c996173 100755 --- a/bin/psycamp +++ b/bin/psycamp | |||
@@ -306,7 +306,7 @@ X | |||
306 | $|=1; | 306 | $|=1; |
307 | 307 | ||
308 | # Net::PSYC::Event doesn't support idle events yet.. TODO | 308 | # Net::PSYC::Event doesn't support idle events yet.. TODO |
309 | #% add(3, 'i', \&timeout, 1); #? X | 309 | add(3, 'i', \&timeout, 1); |
310 | # higher frequency necessary to detect timeouts this way.. | 310 | # higher frequency necessary to detect timeouts this way.. |
311 | # then again, if it's too high timer is sometimes faster | 311 | # then again, if it's too high timer is sometimes faster |
312 | # than rxaudio and produces an erroneous kick.. | 312 | # than rxaudio and produces an erroneous kick.. |
@@ -325,9 +325,9 @@ sub head { | |||
325 | return $rc . $AUTHOR ."\n". &sep('-'); | 325 | return $rc . $AUTHOR ."\n". &sep('-'); |
326 | } | 326 | } |
327 | 327 | ||
328 | sub timeout { | ||
329 | if (!$paused) { | ||
328 | #{ X | 330 | #{ X |
329 | #%sub timeout { | ||
330 | #% if (!$paused) { | ||
331 | #% # HACK for rxaudio which sometimes gets enchanted | 331 | #% # HACK for rxaudio which sometimes gets enchanted |
332 | #% #y $trick = rand(2)>1 ? 'pause' : 'seek 1 1'; | 332 | #% #y $trick = rand(2)>1 ? 'pause' : 'seek 1 1'; |
333 | #% #y $trick = ('pause', 'seek 1 1', 'play')[rand(3)]; | 333 | #% #y $trick = ('pause', 'seek 1 1', 'play')[rand(3)]; |
@@ -338,10 +338,14 @@ sub head { | |||
338 | #% &gin('seek 1 1'); #? X | 338 | #% &gin('seek 1 1'); #? X |
339 | #% &gin('seek 0 1'); #? !X | 339 | #% &gin('seek 0 1'); #? !X |
340 | #% &gin('pause'); #? !X | 340 | #% &gin('pause'); #? !X |
341 | #% } | 341 | #: X |
342 | #% return 3; | 342 | print RED, "\n*** Playback problem. ", RESET, "Skipping $OpenedFile\n"; |
343 | #%} | 343 | # so far timeout only happens when the input file is b0rked, so we skip it |
344 | &next(0); | ||
344 | #} X | 345 | #} X |
346 | } | ||
347 | return 3; | ||
348 | } | ||
345 | 349 | ||
346 | sub ginread { | 350 | sub ginread { |
347 | $_ = <R>; | 351 | $_ = <R>; |
@@ -493,6 +497,7 @@ sub open { | |||
493 | &gin("pausing_keep_force pt_step 1"); | 497 | &gin("pausing_keep_force pt_step 1"); |
494 | &gin("get_property pause"); # ANS_pause=no | 498 | &gin("get_property pause"); # ANS_pause=no |
495 | #} X | 499 | #} X |
500 | $OpenedFile = $file; | ||
496 | $DUR = 0; | 501 | $DUR = 0; |
497 | &sleep(0.3); # have to wait for file to load? | 502 | &sleep(0.3); # have to wait for file to load? |
498 | $scan=0, &seek(5) if $scan; | 503 | $scan=0, &seek(5) if $scan; |