From: Michael R. <mr...@us...> - 2003-05-30 14:10:55
|
Update of /cvsroot/xine/xine-lib/src/dxr3 In directory sc8-pr-cvs1:/tmp/cvs-serv21577/src/dxr3 Modified Files: video_out_dxr3.c Log Message: fix race condition in dxr3 encododers: on_unneeded would be called from decoder's context while frames might still be around in the video_out context Index: video_out_dxr3.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/dxr3/video_out_dxr3.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- video_out_dxr3.c 25 May 2003 19:00:37 -0000 1.79 +++ video_out_dxr3.c 30 May 2003 14:10:50 -0000 1.80 @@ -548,11 +548,10 @@ if (this->fd_video >= 0) { close(this->fd_video); this->fd_video = CLOSED_FOR_DECODER; + /* inform the encoder on next frame's arrival */ + this->need_update = 1; } - /* we do not need the mpeg encoders any more */ - if (this->enc) this->enc->on_unneeded(this); - /* for mpeg source, we don't have to do much. */ this->video_width = width; this->video_iheight = height; @@ -911,6 +910,12 @@ * frame_gen->displayed(frame_gen) ! */ this->enc->on_display_frame(this, frame); } else { + if (this->need_update) { + /* we do not need the mpeg encoders any more */ + if (this->enc && this->enc->on_unneeded) + this->enc->on_unneeded(this); + this->need_update = 0; + } frame_gen->displayed(frame_gen); } } |