[vlc-commits] commit: transcode: fix crash on eof when using threads >=1 ( Rafaël Carré )
git at videolan.org
git at videolan.org
Mon Nov 8 23:56:35 CET 2010
vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Mon Nov 8 23:52:49 2010 +0100| [938585a6302cd1105b4a775ac264492ac629581b] | committer: Rafaël Carré
transcode: fix crash on eof when using threads >=1
For now do not flush encoder buffers (as added in [14054532b4]), but
ideally that should be fixed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=938585a6302cd1105b4a775ac264492ac629581b
---
modules/stream_out/transcode/video.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index a26c8d0..fcbde83 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -597,14 +597,24 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
if( in == NULL )
{
- block_t *p_block;
- do {
- video_timer_start( id->p_encoder );
- p_block = id->p_encoder->pf_encode_video(id->p_encoder, NULL );
- video_timer_stop( id->p_encoder );
- block_ChainAppend( out, p_block );
- } while( p_block );
- return VLC_SUCCESS;
+ if( p_sys->i_threads == 0 )
+ {
+ block_t *p_block;
+ do {
+ video_timer_start( id->p_encoder );
+ p_block = id->p_encoder->pf_encode_video(id->p_encoder, NULL );
+ video_timer_stop( id->p_encoder );
+ block_ChainAppend( out, p_block );
+ } while( p_block );
+ }
+ else
+ {
+ /*
+ * FIXME: we need EncoderThread() to flush buffers and signal us
+ * when it's done so we can send the last frames to the chain
+ */
+ }
+ return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list