[vlc-devel] [PATCH 1/3] decoder: process the last block when closing

Laurent Aimar fenrir at elivagar.org
Wed Aug 3 21:07:11 CEST 2011


On Tue, Aug 02, 2011 at 11:06:47PM -0400, Rafaël Carré wrote:
> Le Tue, 2 Aug 2011 21:32:25 +0200,
> Laurent Aimar <fenrir at elivagar.org> a écrit :
> 
> > > +void EsOutEOS(es_out_t *out)
> > > +{
> > > +    es_out_sys_t   *p_sys = out->p_sys;
> > > +    for (int i = 0; i < p_sys->i_es; i++) {
> > > +        es_out_id_t *id = p_sys->es[i];
> > > +        decoder_t *p_dec = id->p_dec;
> > p_dec can be NULL and you have locking issue (but it should probably
> > be automatically fixed when you implement it as advised below.
> 
> Ok (not sure how locking issue can be fixed though :?)
 If you change it to a es_out_Control() command it should work
by default.

> > > index 7927480..efab1b4 100644
> > > --- a/src/input/input.c
> > > +++ b/src/input/input.c
> > > @@ -617,6 +617,7 @@ static void MainLoopDemux( input_thread_t
> > > *p_input, bool *pb_changed, bool *pb_d {
> > >          msg_Dbg( p_input, "EOF reached" );
> > >          p_input->p->input.b_eof = true;
> > > +        EsOutEOS(p_input->p->p_es_out_display);
> >  Now, you will have to send this order through p_input->p->p_es_out
> > which mean you need to let it pass through es_out_timeshift.
> >  For that you can look at how ES_OUT_SET_TIMES/es_out_SetTimes are
> > implemented.
> 
> Using es_out_display directly seems appropriate because we need to
> notify the decoder and es_out_timeshift is not associated to decoders.
 The timeshift delays data send to the encoder (for example the ES data
are send to es_out_timeshift which then transmits them to es_out_display).
The EOS signal should follow the same path.


-- 
fenrir



More information about the vlc-devel mailing list