mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
libeplayer3: add hack to decrease libavcodec probe size
almost disable the libavcodec format probing when using
"myts://" instead of "file://" urls to improve startup speed
for timeshift etc
Origin commit data
------------------
Branch: master
Commit: 4d43213158
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-10-03 (Wed, 03 Oct 2012)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -809,6 +809,8 @@ int container_ffmpeg_init(Context_t *context, char * filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
avContext->flags = AVFMT_FLAG_GENPTS;
|
avContext->flags = AVFMT_FLAG_GENPTS;
|
||||||
|
if (context->playback->noprobe)
|
||||||
|
avContext->max_analyze_duration = 1;
|
||||||
|
|
||||||
ffmpeg_printf(20, "find_streaminfo\n");
|
ffmpeg_printf(20, "find_streaminfo\n");
|
||||||
|
|
||||||
|
@@ -31,6 +31,7 @@ typedef struct PlaybackHandler_s {
|
|||||||
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
||||||
char * uri;
|
char * uri;
|
||||||
off_t size;
|
off_t size;
|
||||||
|
unsigned char noprobe; /* hack: only minimal probing in av_find_stream_info */
|
||||||
} PlaybackHandler_t;
|
} PlaybackHandler_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -167,11 +167,17 @@ static int PlaybackOpen(Context_t *context, char * uri) {
|
|||||||
context->playback->uri = strdup(uri);
|
context->playback->uri = strdup(uri);
|
||||||
|
|
||||||
if (!context->playback->isPlaying) {
|
if (!context->playback->isPlaying) {
|
||||||
if (!strncmp("file://", uri, 7)) {
|
if (!strncmp("file://", uri, 7) || !strncmp("myts://", uri, 7)) {
|
||||||
char * extension = NULL;
|
char * extension = NULL;
|
||||||
context->playback->isFile = 1;
|
context->playback->isFile = 1;
|
||||||
context->playback->isHttp = 0;
|
context->playback->isHttp = 0;
|
||||||
context->playback->isUPNP = 0;
|
context->playback->isUPNP = 0;
|
||||||
|
if (!strncmp("myts://", uri, 7)) {
|
||||||
|
memcpy(context->playback->uri, "file", 4);
|
||||||
|
memcpy(uri, "file", 4);
|
||||||
|
context->playback->noprobe = 1;
|
||||||
|
} else
|
||||||
|
context->playback->noprobe = 0;
|
||||||
|
|
||||||
getExtension(uri+7, &extension);
|
getExtension(uri+7, &extension);
|
||||||
|
|
||||||
@@ -1059,4 +1065,5 @@ PlaybackHandler_t PlaybackHandler = {
|
|||||||
&Command,
|
&Command,
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
|
0
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user