arm try fix fast backward

Origin commit data
------------------
Branch: master
Commit: 3c4f9f328c
Author: TangoCash <eric@loxat.de>
Date: 2018-01-21 (Sun, 21 Jan 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2018-01-21 15:46:53 +01:00
parent 4f342d07e0
commit 25f676d956
2 changed files with 39 additions and 19 deletions

View File

@@ -95,7 +95,22 @@ static void SupervisorThread(Context_t *context)
hasThreadStarted = 1;
playback_printf(10, ">\n");
while (context && context->playback && context->playback->isPlaying && !context->playback->abortRequested)
usleep(100000);
{
if (context->playback->BackWard != 0)
{
/* Offset -3 seconds for backward
* so initial backward speed is 4x */
int64_t pos = (int64_t)context->playback->Speed - 3;
playback_printf(10, "Speed %d BackWard %d to seek %lld\n", context->playback->Speed, context->playback->BackWard, pos);
context->playback->isSeeking = 1;
context->output->Command(context, OUTPUT_CLEAR, NULL);
context->container->selectedContainer->Command(context, CONTAINER_SEEK, &pos);
context->playback->isSeeking = 0;
usleep(350000);
} else {
usleep(100000);
}
}
playback_printf(10, "<\n");
hasThreadStarted = 2;
PlaybackTerminate(context);
@@ -310,8 +325,10 @@ static int32_t PlaybackContinue(Context_t *context)
(context->playback->isPaused || context->playback->isForwarding ||
context->playback->BackWard || context->playback->SlowMotion))
{
if (context->playback->SlowMotion || context->playback->isForwarding)
if (context->playback->SlowMotion || context->playback->isForwarding || context->playback->BackWard)
context->output->Command(context, OUTPUT_CLEAR, NULL);
if (context->playback->BackWard)
context->output->Command(context, OUTPUT_AUDIOMUTE, "0");
context->playback->isPaused = 0;
//context->playback->isPlaying = 1;
context->playback->isForwarding = 0;
@@ -453,15 +470,16 @@ static int PlaybackFastBackward(Context_t *context, int *speed)
{
context->playback->BackWard = 0;
context->playback->Speed = 0; /* reverse end */
context->output->Command(context, OUTPUT_AUDIOMUTE, "0");
}
else
{
context->playback->isSeeking = 1;
context->playback->Speed = *speed;
context->playback->BackWard = 2 ^ (*speed);
playback_printf(1, "S %d B %f\n", context->playback->Speed, context->playback->BackWard);
context->playback->BackWard = 1;
context->output->Command(context, OUTPUT_AUDIOMUTE, "1");
playback_printf(1, "S %d B %d\n", context->playback->Speed, context->playback->BackWard);
}
context->output->Command(context, OUTPUT_AUDIOMUTE, "1");
context->output->Command(context, OUTPUT_CLEAR, NULL);
if (context->output->Command(context, OUTPUT_REVERSE, NULL) < 0)
{