[vlc-devel] Seek support in imem access module

Ilkka Ollakka ileoo at videolan.org
Wed Jul 14 10:16:44 CEST 2010


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.

> ---
>  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.

> +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* 

> +                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?

-- 
Ilkka Ollakka
The years of peak mental activity are undoubtedly between the ages of
four and eighteen.  At four we know all the questions, at eighteen all
the answers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100714/55e927e0/attachment.sig>


More information about the vlc-devel mailing list