[vlc-devel] Seek support in imem access module

Kamil Klimek naresh at tlen.pl
Wed Jul 14 10:20:49 CEST 2010


Wiadomość napisana przez Ilkka Ollakka w dniu 2010-07-14, o godz. 10:16:

> On Tue, Jul 13, 2010 at 02:05:07PM +0200, Kamil Klimek wrote:
>> From dee6a5cc96d19d43313c2bfddfb66402465880c7 Mon Sep 17 00:00:00 2001
>> From: unknown <Solutions at .(none)>
>> Date: Tue, 13 Jul 2010 13:52:35 +0200
>> Subject: [PATCH 2/2] seek support in imem access module
> 
> I think you did something wrong when creating this patch in general (as
> basicly this removes the old file and replaces it with new one). Few
> comments below even if I'm not really familiar with imem and those
> stuff.

Sry, I didn't notice that one. I'll fix that

>> ---
>> modules/access/imem.c | 1504 +++++++++++++++++++++++++------------------------
>> 1 files changed, 764 insertions(+), 740 deletions(-)
> 
>> +
> 
> ah theres the reason, tell git not
> to bother with those (maybe git-config core.autocrlf true and git-config
> code.safecrlf true helps in here, not sure).
> 
>> +    tmp  = var_InheritString(object, "imem-seek");
>> +    if (tmp)
>> +        sys->source.seek = (imem_seek_t)(intptr_t)strtoll(tmp, NULL, 0);
>> +    free(tmp);
> 
>> +static int ControlAccess(access_t *access, int i_query, va_list args)
>> +{
>> +    imem_sys_t *sys = (imem_sys_t*)access->p_sys;
>> +
>> +    switch (i_query)
>> +    {
>> +    case ACCESS_CAN_SEEK:
>> +    case ACCESS_CAN_FASTSEEK: {
>> +        bool *b = va_arg( args, bool* );
>> +        *b = true;
>> +        return VLC_SUCCESS;
> 
> as sys->source.seek is by default NULL, shouldn't this one check it and
> return true/false based on that.

Good point. I'll Fix that.

>> +static int Seek(access_t *access, uint64_t seekTo)
>> +{
>> +    imem_sys_t * sys = (imem_sys_t*)access->p_sys;
>> +
>> +    if(sys->source.seek)
>> +        return sys->source.seek(sys->source.data, seekTo);
>> +
>> +    return -1;
> 
> -1 ? how about VLC_E* 

I'm not so familiar with VLC api, I'll get on it.

>> +                memcpy(block->p_buffer, buffer, buffer_size);
>> +
>> +                es_out_Control(demux->out, ES_OUT_SET_PCR, block->i_dts);
>> +                es_out_Send(demux->out, sys->es, block);
>> +            }
>> +        }
>> +
>> +        sys->dts = dts;
>> +
>> +        sys->source.release(sys->source.data, sys->source.cookie,
>> +                            buffer_size, buffer);
>> +    }
>> +    sys->deadline = VLC_TS_INVALID;
>> +    return 1;
> 
> Here VLC_SUCCESS would be better too?

This one is actually not mine. But I can replace it also




More information about the vlc-devel mailing list