Commit 9283136a authored by Antoine Cellerier's avatar Antoine Cellerier

Fix ffmpeg muxer header writing. This allows flash streaming with VLC. Example command line:

./vlc --sout "#transcode{vcodec=FLV1,acodec=mp3,sameplerate=44100}:std{access=http{mime=video/x-flv},mux=ffmpeg{mux=flv},dst=0.0.0.0:8080/stream.flv}" ~/media/aladin.avi --loop -vvv --color -I dummy

Patch from Olivier Houchard. Thanks.
parent d92fc212
......@@ -381,14 +381,17 @@ static int Mux( sout_mux_t *p_mux )
{
msg_Dbg( p_mux, "writing header" );
p_sys->b_write_header = VLC_FALSE;
if( av_write_header( p_sys->oc ) < 0 )
{
msg_Err( p_mux, "could not write header" );
p_sys->b_write_header = VLC_FALSE;
p_sys->b_error = VLC_TRUE;
return VLC_EGENERIC;
}
put_flush_packet( &p_sys->oc->pb );
p_sys->b_write_header = VLC_FALSE;
}
for( ;; )
......@@ -441,6 +444,9 @@ static int IOWrite( void *opaque, uint8_t *buf, int buf_size )
block_t *p_buf = block_New( p_mux->p_sout, buf_size );
if( buf_size > 0 ) memcpy( p_buf->p_buffer, buf, buf_size );
if( p_mux->p_sys->b_write_header )
p_buf->i_flags |= BLOCK_FLAG_HEADER;
i_ret = sout_AccessOutWrite( p_mux->p_access, p_buf );
return i_ret ? i_ret : -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment