- libeplayer3: sync with max_10

This commit is contained in:
vanhofen
2023-01-24 21:00:47 +01:00
committed by Thilo Graf
parent 02994964e7
commit c0034ff0b7
65 changed files with 1100 additions and 959 deletions

View File

@@ -73,6 +73,8 @@ bool isBufferedOutput = false;
pthread_mutex_t LinuxDVBmutex;
static int64_t last_pts = 0;
/* ***************************** */
/* Prototypes */
/* ***************************** */
@@ -94,7 +96,6 @@ int LinuxDvbStop(Context_t *context, char *type);
#define getLinuxDVBMutex() pthread_mutex_lock(&LinuxDVBmutex)
#define releaseLinuxDVBMutex() pthread_mutex_unlock(&LinuxDVBmutex)
int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type)
{
uint8_t video = !strcmp("video", type);
@@ -196,7 +197,7 @@ int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type __attri
int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts)
{
*((unsigned long long int *)pts) = (unsigned long long int)0;
*((unsigned long long int *)pts) = (unsigned long long int)last_pts;
return 0;
}
@@ -207,7 +208,6 @@ int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned l
int LinuxDvbSwitch(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
{
return cERR_LINUXDVB_NO_ERROR;
}
@@ -231,7 +231,7 @@ static int Write(Context_t *context, void *_out)
audio = !strcmp("audio", out->type);
linuxdvb_printf(20, "DataLength=%u PrivateLength=%u Pts=%"PRIu64" FrameRate=%d\n",
out->len, out->extralen, out->pts, out->frameRate);
out->len, out->extralen, out->pts, out->frameRate);
linuxdvb_printf(20, "v%d a%d\n", video, audio);
if (video)
@@ -300,6 +300,16 @@ static int Write(Context_t *context, void *_out)
}
}
if (out->pts != INVALID_PTS_VALUE)
{
if (out->pts > last_pts)
{
usleep((out->pts - last_pts) / 90 * 900);
//usleep((out->pts - last_pts) / 90 * 500);
}
last_pts = out->pts;
}
call.fd = videofd;
call.data = out->data;
call.len = out->len;