[vlc-devel] Re: Kasenna pause and trickplay patch
Dermot McGahon
dermot at dspsrv.com
Tue Nov 16 15:03:14 CET 2004
On Tue, 16 Nov 2004 14:17:37 +0100, Jean-Paul Saman
<jean-paul.saman at planet.nl> wrote:
> This is great functionality when commited. I only have some naming
> comments they are inlined in the patch. Again good work!
[-]
>> Patch to implement pause/resume, fast forward and rewind for Kasenna
>> Servers. There is a corresponding patch for this functionality against
>> LIVE.COM which I will submit to the relevant list.
>>
>> This was implemented based on suggestions (mostly from fenrir) on irc
>> and is work in progress. It works, but at this point I'm just hoping
>> for a review, not a commit.
>> Index: src/input/input.c
>> ===================================================================
>> --- src/input/input.c (revision 9353)
>> +++ src/input/input.c (working copy)
The patch was created using svn diff. It looks like there have been
fairly big changes since I started working on this. svn update doesn't
appear to have merged these into my working copy. Hopefully fen, you
will still be able to review the input.c changes.
>> + i_ret = demux2_Control( p_input->input.p_demux,
>> DEMUX_SET_RATE, i_rate, VLC_FALSE );
>>
>> - /* Reset clock */
>> - es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR );
>> + if (i_ret)
>> + {
>> + var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL );
>>
>> - b_force_update = VLC_TRUE;
>> + /* We haven't send data to decoder when rate != default */
>> + if( i_rate == INPUT_RATE_DEFAULT )
>> + input_EsOutDiscontinuity( p_input->p_es_out, VLC_TRUE );
>> +
>> + /* Reset clock */
>> + es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR );
>> +
>> + b_force_update = VLC_TRUE;
>> + }
> Make this more human readible and call it "fforward" or "fastforward"
>
>> + var_Create( p_intf, "rw", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
>> + var_AddCallback( p_intf, "rw", Input, NULL );
Done, changed to "fastforward" and "rewind".
>> + fprintf( stderr, "options=%s\n", psz_options);
>>
>>
> use vlc functions here and do not use fprintf(), for instance:
Just in for debugging. Removed now, and other other instance.
>> + if (p_sys->i_rate == INPUT_RATE_MAX)
>> + p_sys->i_running_duration += duration * 12;
>> + else if (p_sys->i_rate == INPUT_RATE_MIN)
>> + p_sys->i_running_duration -= duration * 12;
>> + else
>> + p_sys->i_running_duration += duration;
To explain for clarity. The Kasenna server does not store the current
play time (NPT, normal play time). So, on resume from PAUSE, the client
must supply the point to restart at. Same goes for changing from one
speed to another.
The Kasenna server only supports x12 (fast forward) and x-12 (rewind)
speeds. In ff or rw mode, adjust the normal play time accordingly i.e
1 second of video played at fast forward, needs to be accounted for as
12 seconds of normal speed video, for when you want to return to normal
speed.
>> + msg_Dbg(p_demux, "duration = %u", (unsigned
>> int)p_sys->i_running_duration / 1000000);
This is more debugging output and is now removed.
Dermot.
--
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel
mailing list