mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
reduce http timeout to 4s and make it configurable
Origin commit data
------------------
Branch: master
Commit: 4a56ebd0b3
Author: skyjet18 <57456827+skyjet18@users.noreply.github.com>
Date: 2023-01-24 (Tue, 24 Jan 2023)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1804,7 +1804,10 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, uin
|
||||
else if (0 == strncmp(filename, "http://", 7) ||
|
||||
0 == strncmp(filename, "https://", 8))
|
||||
{
|
||||
av_dict_set(&avio_opts, "timeout", "20000000", 0); //20sec
|
||||
char num[16];
|
||||
|
||||
sprintf(num, "%u000", context->playback->httpTimeout);
|
||||
av_dict_set(&avio_opts, "timeout", num, 0); // default is 4s
|
||||
av_dict_set(&avio_opts, "reconnect", "1", 0);
|
||||
if (context->playback->isTSLiveMode) // special mode for live TS stream with skip packet
|
||||
{
|
||||
|
6
libeplayer3/external/ffmpeg/mathops.h
vendored
6
libeplayer3/external/ffmpeg/mathops.h
vendored
@@ -37,11 +37,7 @@
|
||||
static inline av_const int sign_extend(int val, unsigned bits)
|
||||
{
|
||||
unsigned shift = 8 * sizeof(int) - bits;
|
||||
union
|
||||
{
|
||||
unsigned u;
|
||||
int s;
|
||||
} v = { (unsigned) val << shift };
|
||||
union { unsigned u; int s; } v = { (unsigned) val << shift };
|
||||
return v.s >> shift;
|
||||
}
|
||||
#endif
|
||||
|
@@ -66,6 +66,9 @@ typedef struct PlaybackHandler_s
|
||||
uint8_t noprobe; /* hack: only minimal probing in av_find_stream_info */
|
||||
uint8_t isLoopMode;
|
||||
uint8_t isTSLiveMode;
|
||||
uint32_t httpTimeout; // in ms
|
||||
|
||||
void *stamp;
|
||||
} PlaybackHandler_t;
|
||||
|
||||
#endif
|
||||
|
@@ -518,10 +518,7 @@ static int ParseParams(int argc, char *argv[], PlayFiles_t *playbackFiles, int *
|
||||
{
|
||||
int ret = 0;
|
||||
int c;
|
||||
//int digit_optind = 0;
|
||||
//int aopt = 0, bopt = 0;
|
||||
//char *copt = 0, *dopt = 0;
|
||||
while ((c = getopt(argc, argv, "we3dlsrimva:n:x:u:c:h:o:p:P:t:9:0:1:4:f:b:F:S:O:")) != -1)
|
||||
while ((c = getopt(argc, argv, "G:W:H:A:V:U:we3dlsrimva:n:x:u:c:h:o:p:P:t:9:0:1:4:f:b:F:S:O:T:")) != -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -656,6 +653,11 @@ static int ParseParams(int argc, char *argv[], PlayFiles_t *playbackFiles, int *
|
||||
map_inter_file_path(playbackFiles->szFirstMoovAtomFile);
|
||||
}
|
||||
break;
|
||||
case 'T':
|
||||
PlaybackHandler.httpTimeout = (uint32_t) strtoul(optarg, NULL, 10);
|
||||
printf("Setting http timeout to %u ms\n", PlaybackHandler.httpTimeout);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("?? getopt returned character code 0%o ??\n", c);
|
||||
ret = -1;
|
||||
@@ -700,6 +702,7 @@ int main(int argc, char *argv[])
|
||||
char argvBuff[256];
|
||||
memset(argvBuff, '\0', sizeof(argvBuff));
|
||||
int commandRetVal = -1;
|
||||
|
||||
/* inform client that we can handle additional commands */
|
||||
fprintf(stderr, "{\"EPLAYER3_EXTENDED\":{\"version\":%d}}\n", 55);
|
||||
|
||||
|
@@ -478,6 +478,7 @@ static int32_t PlaybackTerminate(Context_t *context)
|
||||
}
|
||||
|
||||
ret = context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL);
|
||||
|
||||
if (context && context->playback)
|
||||
{
|
||||
context->playback->isPaused = 0;
|
||||
@@ -487,6 +488,7 @@ static int32_t PlaybackTerminate(Context_t *context)
|
||||
context->playback->SlowMotion = 0;
|
||||
context->playback->Speed = 0;
|
||||
}
|
||||
|
||||
if (context && context->output)
|
||||
context->output->Command(context, OUTPUT_STOP, NULL);
|
||||
}
|
||||
@@ -1014,5 +1016,7 @@ PlaybackHandler_t PlaybackHandler =
|
||||
0, //size
|
||||
0, //noprobe
|
||||
0, //isLoopMode
|
||||
0 //isTSLiveMode
|
||||
0, //isTSLiveMode
|
||||
4000, //httpTimeout
|
||||
NULL //stamp
|
||||
};
|
||||
|
Reference in New Issue
Block a user