mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-28 16:00:58 +02:00
arm try fix fast backward
Origin commit data
------------------
Branch: master
Commit: 2c7c605ff5
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:
@@ -59,7 +59,7 @@
|
|||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* Makros/Constants */
|
/* Makros/Constants */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
#if (LIBAVFORMAT_VERSION_MAJOR > 57)
|
#if (LIBAVFORMAT_VERSION_MAJOR > 56)
|
||||||
#define TS_BYTES_SEEKING 0
|
#define TS_BYTES_SEEKING 0
|
||||||
#else
|
#else
|
||||||
#define TS_BYTES_SEEKING 1
|
#define TS_BYTES_SEEKING 1
|
||||||
@@ -2365,9 +2365,10 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
|||||||
Track_t *audioTrack = NULL;
|
Track_t *audioTrack = NULL;
|
||||||
Track_t *current = NULL;
|
Track_t *current = NULL;
|
||||||
seek_target_flag = 0;
|
seek_target_flag = 0;
|
||||||
|
sec *= AV_TIME_BASE;
|
||||||
if (!absolute)
|
if (!absolute)
|
||||||
{
|
{
|
||||||
ffmpeg_printf(10, "seeking %f sec\n", sec);
|
ffmpeg_printf(10, "seeking %lld sec\n", sec / AV_TIME_BASE);
|
||||||
if (sec == 0)
|
if (sec == 0)
|
||||||
{
|
{
|
||||||
ffmpeg_err("sec = 0 ignoring\n");
|
ffmpeg_err("sec = 0 ignoring\n");
|
||||||
@@ -2382,14 +2383,15 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
|||||||
ffmpeg_err("fail to get current PTS\n");
|
ffmpeg_err("fail to get current PTS\n");
|
||||||
return cERR_CONTAINER_FFMPEG_ERR;
|
return cERR_CONTAINER_FFMPEG_ERR;
|
||||||
}
|
}
|
||||||
sec += currPts / 90000;
|
sec += (currPts / 90000 * AV_TIME_BASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sec < 0)
|
||||||
|
{
|
||||||
|
sec = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ffmpeg_printf(10, "goto %d sec\n", sec);
|
ffmpeg_printf(10, "goto %lld sec\n", sec / AV_TIME_BASE);
|
||||||
if (sec < 0)
|
|
||||||
{
|
|
||||||
sec = 0;
|
|
||||||
}
|
|
||||||
context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack);
|
context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack);
|
||||||
context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack);
|
context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack);
|
||||||
if (videoTrack != NULL)
|
if (videoTrack != NULL)
|
||||||
@@ -2415,7 +2417,7 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
|||||||
releaseMutex(__FILE__, __FUNCTION__, __LINE__);
|
releaseMutex(__FILE__, __FUNCTION__, __LINE__);
|
||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
}
|
}
|
||||||
ffmpeg_printf(10, "iformat->flags %d\n", avContextTab[0]->iformat->flags);
|
ffmpeg_printf(10, "iformat->flags 0x%08x\n", avContextTab[0]->iformat->flags);
|
||||||
#if defined(TS_BYTES_SEEKING) && TS_BYTES_SEEKING
|
#if defined(TS_BYTES_SEEKING) && TS_BYTES_SEEKING
|
||||||
if (avContextTab[0]->iformat->flags & AVFMT_TS_DISCONT)
|
if (avContextTab[0]->iformat->flags & AVFMT_TS_DISCONT)
|
||||||
{
|
{
|
||||||
@@ -2426,11 +2428,11 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
|||||||
* about 10 seconds, backward does not work.
|
* about 10 seconds, backward does not work.
|
||||||
*/
|
*/
|
||||||
off_t pos = avio_tell(avContextTab[0]->pb);
|
off_t pos = avio_tell(avContextTab[0]->pb);
|
||||||
ffmpeg_printf(10, "pos %lld %d\n", pos, avContextTab[0]->bit_rate);
|
ffmpeg_printf(10, "pos %lld %lld\n", pos, avContextTab[0]->bit_rate);
|
||||||
if (avContextTab[0]->bit_rate)
|
if (avContextTab[0]->bit_rate)
|
||||||
{
|
{
|
||||||
sec *= avContextTab[0]->bit_rate / 8;
|
sec *= avContextTab[0]->bit_rate / 8;
|
||||||
ffmpeg_printf(10, "bit_rate %d\n", avContextTab[0]->bit_rate);
|
ffmpeg_printf(10, "bit_rate %lld\n", avContextTab[0]->bit_rate);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2441,14 +2443,14 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
|||||||
{
|
{
|
||||||
pos = 0;
|
pos = 0;
|
||||||
}
|
}
|
||||||
ffmpeg_printf(10, "1. seeking to position %lld bytes ->sec %d\n", pos, sec);
|
ffmpeg_printf(10, "1. seeking to position %lld bytes ->sec %lld\n", pos / AV_TIME_BASE, sec / AV_TIME_BASE);
|
||||||
seek_target_bytes = pos;
|
seek_target_bytes = pos / AV_TIME_BASE;
|
||||||
do_seek_target_bytes = 1;
|
do_seek_target_bytes = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
seek_target_seconds = sec * AV_TIME_BASE;
|
seek_target_seconds = sec;
|
||||||
do_seek_target_seconds = 1;
|
do_seek_target_seconds = 1;
|
||||||
}
|
}
|
||||||
releaseMutex(__FILE__, __FUNCTION__, __LINE__);
|
releaseMutex(__FILE__, __FUNCTION__, __LINE__);
|
||||||
|
@@ -95,7 +95,22 @@ static void SupervisorThread(Context_t *context)
|
|||||||
hasThreadStarted = 1;
|
hasThreadStarted = 1;
|
||||||
playback_printf(10, ">\n");
|
playback_printf(10, ">\n");
|
||||||
while (context && context->playback && context->playback->isPlaying && !context->playback->abortRequested)
|
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");
|
playback_printf(10, "<\n");
|
||||||
hasThreadStarted = 2;
|
hasThreadStarted = 2;
|
||||||
PlaybackTerminate(context);
|
PlaybackTerminate(context);
|
||||||
@@ -310,8 +325,10 @@ static int32_t PlaybackContinue(Context_t *context)
|
|||||||
(context->playback->isPaused || context->playback->isForwarding ||
|
(context->playback->isPaused || context->playback->isForwarding ||
|
||||||
context->playback->BackWard || context->playback->SlowMotion))
|
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);
|
context->output->Command(context, OUTPUT_CLEAR, NULL);
|
||||||
|
if (context->playback->BackWard)
|
||||||
|
context->output->Command(context, OUTPUT_AUDIOMUTE, "0");
|
||||||
context->playback->isPaused = 0;
|
context->playback->isPaused = 0;
|
||||||
//context->playback->isPlaying = 1;
|
//context->playback->isPlaying = 1;
|
||||||
context->playback->isForwarding = 0;
|
context->playback->isForwarding = 0;
|
||||||
@@ -453,15 +470,16 @@ static int PlaybackFastBackward(Context_t *context, int *speed)
|
|||||||
{
|
{
|
||||||
context->playback->BackWard = 0;
|
context->playback->BackWard = 0;
|
||||||
context->playback->Speed = 0; /* reverse end */
|
context->playback->Speed = 0; /* reverse end */
|
||||||
|
context->output->Command(context, OUTPUT_AUDIOMUTE, "0");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context->playback->isSeeking = 1;
|
context->playback->isSeeking = 1;
|
||||||
context->playback->Speed = *speed;
|
context->playback->Speed = *speed;
|
||||||
context->playback->BackWard = 2 ^ (*speed);
|
context->playback->BackWard = 1;
|
||||||
playback_printf(1, "S %d B %f\n", context->playback->Speed, context->playback->BackWard);
|
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);
|
context->output->Command(context, OUTPUT_CLEAR, NULL);
|
||||||
if (context->output->Command(context, OUTPUT_REVERSE, NULL) < 0)
|
if (context->output->Command(context, OUTPUT_REVERSE, NULL) < 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user