]> git.sesse.net Git - vlc/commitdiff
transcode: fix crash on eof when using threads >=1
authorRafaël Carré <rafael.carre@gmail.com>
Mon, 8 Nov 2010 22:52:49 +0000 (23:52 +0100)
committerRafaël Carré <rafael.carre@gmail.com>
Mon, 8 Nov 2010 22:56:30 +0000 (23:56 +0100)
For now do not flush encoder buffers (as added in [14054532b4]), but
ideally that should be fixed

modules/stream_out/transcode/video.c

index a26c8d0f8b305ca4fed737aa879914be47dd13c5..fcbde831264e3546b1d4e54e9663d5b3305a8db0 100644 (file)
@@ -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;
     }