Skip to content
Snippets Groups Projects

input: thumbnailer: remove seek to same position

2 unresolved threads
+ 7
3
@@ -177,11 +177,15 @@ RunnableRun(void *userdata)
goto error;
if (task->seek_target.type == VLC_THUMBNAILER_SEEK_TIME)
input_SetTime(input, task->seek_target.time, task->fast_seek);
{
if (task->seek_target.time != VLC_TICK_0)
    • This assumes the provided times are shifted with VLC_TICK_0, as seen in the next commit. But IMO this is not the proper place to do the shift. So IMO is should be tested against 0.

      Also it seems that the goal is to avoid a costly seeking operation, because INPUT_CONTROL_SET_TIME ends up doing a PCR Reset no matter what. But it doesn't have to be that way. We can call vlc_demux_GetTime() and check that it's not the same value as the current time. If it is then we don't need the PCR reset and the demux_SetTime(). And you have optimized seeking for input_SetTime() callers and vlc_player_SeekByTime() callers.

Please register or sign in to reply
input_SetTime(input, task->seek_target.time, task->fast_seek);
}
else
{
assert(task->seek_target.type == VLC_THUMBNAILER_SEEK_POS);
input_SetPosition(input, task->seek_target.pos, task->fast_seek);
if (task->seek_target.pos != 0.f)
input_SetPosition(input, task->seek_target.pos, task->fast_seek);
}
int ret = input_Start(input);
@@ -261,7 +265,7 @@ vlc_thumbnailer_RequestByTime( vlc_thumbnailer_t *thumbnailer,
{
struct seek_target seek_target = {
.type = VLC_THUMBNAILER_SEEK_TIME,
.time = time,
.time = VLC_TICK_0 + time,
    • It seems that it should be done closer to the call using this value: the one calling input_SetTime().

      But then if you dig into what it does, it calls INPUT_CONTROL_SET_TIME. The same way vlc_player_SeekByTime() does. And the documentation of vlc_player_SeekByTime() doesn't mention that the time has to be shifted and it's in fact not shifted either. So if the problem exists here, it exists there and might be fixed in a more generic way. Probably in the single location that handles this internal control in input.c

Please register or sign in to reply
};
return RequestCommon(thumbnailer, seek_target, speed, item, timeout, cb,
userdata);
Loading