Commit f076665a authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/theora.c, modules/stream_out/transcode.c: fixed encoder module unloading.

* modules/mux/ogg.c: fixed packing of OggDS structure.
parent 5bf1e98f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* theora.c: theora decoder module making use of libtheora. * theora.c: theora decoder module making use of libtheora.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: theora.c,v 1.10 2003/10/08 23:00:40 gbazin Exp $ * $Id: theora.c,v 1.11 2003/10/09 11:48:41 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -710,7 +710,7 @@ static void CloseEncoder( vlc_object_t *p_this ) ...@@ -710,7 +710,7 @@ static void CloseEncoder( vlc_object_t *p_this )
encoder_sys_t *p_sys = p_enc->p_sys; encoder_sys_t *p_sys = p_enc->p_sys;
theora_info_clear( &p_sys->ti ); theora_info_clear( &p_sys->ti );
//theora_comment_clear( &p_sys->tc ); theora_comment_clear( &p_sys->tc );
free( p_sys ); free( p_sys );
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ogg.c: ogg muxer module for vlc * ogg.c: ogg muxer module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ogg.c,v 1.14 2003/09/29 22:37:36 gbazin Exp $ * $Id: ogg.c,v 1.15 2003/10/09 11:48:41 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -110,13 +110,17 @@ typedef struct ...@@ -110,13 +110,17 @@ typedef struct
int32_t i_buffer_size; int32_t i_buffer_size;
int16_t i_bits_per_sample; int16_t i_bits_per_sample;
int16_t i_padding_0; // hum hum
int16_t i_padding_0; /* Because the original is using MSVC packing style */
union union
{ {
oggds_header_video_t video; oggds_header_video_t video;
oggds_header_audio_t audio; oggds_header_audio_t audio;
} header; } header;
int32_t i_padding_1; /* Because the original is using MSVC packing style */
} oggds_header_t; } oggds_header_t;
/* Helper writer functions */ /* Helper writer functions */
...@@ -330,6 +334,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -330,6 +334,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_stream->i_sout_headers = 0; p_stream->i_sout_headers = 0;
memset( &p_stream->oggds_header, 0, sizeof(p_stream->oggds_header) );
p_stream->oggds_header.i_packet_type = PACKET_TYPE_HEADER; p_stream->oggds_header.i_packet_type = PACKET_TYPE_HEADER;
switch( p_input->p_fmt->i_cat ) switch( p_input->p_fmt->i_cat )
{ {
...@@ -338,7 +343,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -338,7 +343,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
{ {
case VLC_FOURCC( 'm', 'p','4', 'v' ): case VLC_FOURCC( 'm', 'p','4', 'v' ):
case VLC_FOURCC( 'D', 'I','V', '3' ): case VLC_FOURCC( 'D', 'I','V', '3' ):
memcpy( p_stream->oggds_header.stream_type, "video ", 8 ); memcpy( p_stream->oggds_header.stream_type, "video", 5 );
if( p_stream->i_fourcc == VLC_FOURCC( 'm', 'p','4', 'v' ) ) if( p_stream->i_fourcc == VLC_FOURCC( 'm', 'p','4', 'v' ) )
{ {
memcpy( p_stream->oggds_header.sub_type, "XVID", 4 ); memcpy( p_stream->oggds_header.sub_type, "XVID", 4 );
...@@ -352,7 +357,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -352,7 +357,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
SetQWLE( &p_stream->oggds_header.i_time_unit, SetQWLE( &p_stream->oggds_header.i_time_unit,
I64C(10000000)/(int64_t)25 ); // FIXME (25fps) I64C(10000000)/(int64_t)25 ); // FIXME (25fps)
SetQWLE( &p_stream->oggds_header.i_samples_per_unit, 1 ); SetQWLE( &p_stream->oggds_header.i_samples_per_unit, 1 );
SetDWLE( &p_stream->oggds_header.i_default_len, 0 ); /* ??? */ SetDWLE( &p_stream->oggds_header.i_default_len, 1 ); /* ??? */
SetDWLE( &p_stream->oggds_header.i_buffer_size, 1024*1024 ); SetDWLE( &p_stream->oggds_header.i_buffer_size, 1024*1024 );
SetWLE( &p_stream->oggds_header.i_bits_per_sample, 0 ); SetWLE( &p_stream->oggds_header.i_bits_per_sample, 0 );
SetDWLE( &p_stream->oggds_header.header.video.i_width, SetDWLE( &p_stream->oggds_header.header.video.i_width,
...@@ -377,7 +382,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -377,7 +382,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
{ {
case VLC_FOURCC( 'm', 'p','g', 'a' ): case VLC_FOURCC( 'm', 'p','g', 'a' ):
case VLC_FOURCC( 'a', '5','2', ' ' ): case VLC_FOURCC( 'a', '5','2', ' ' ):
memcpy( p_stream->oggds_header.stream_type, "audio ", 8 ); memcpy( p_stream->oggds_header.stream_type, "audio", 5 );
if( p_stream->i_fourcc == VLC_FOURCC( 'm', 'p','g', 'a' ) ) if( p_stream->i_fourcc == VLC_FOURCC( 'm', 'p','g', 'a' ) )
{ {
memcpy( p_stream->oggds_header.sub_type, "55 ", 4 ); memcpy( p_stream->oggds_header.sub_type, "55 ", 4 );
...@@ -389,7 +394,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -389,7 +394,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
SetDWLE( &p_stream->oggds_header.i_size, SetDWLE( &p_stream->oggds_header.i_size,
sizeof( oggds_header_t ) - 1); sizeof( oggds_header_t ) - 1);
SetQWLE( &p_stream->oggds_header.i_time_unit, 0 /* not used */ ); SetQWLE( &p_stream->oggds_header.i_time_unit, 0 /* not used */ );
SetDWLE( &p_stream->oggds_header.i_default_len, 0 /* not used */ ); SetDWLE( &p_stream->oggds_header.i_default_len, 1 );
SetDWLE( &p_stream->oggds_header.i_buffer_size, 30*1024 ); SetDWLE( &p_stream->oggds_header.i_buffer_size, 30*1024 );
SetQWLE( &p_stream->oggds_header.i_samples_per_unit, SetQWLE( &p_stream->oggds_header.i_samples_per_unit,
p_input->p_fmt->i_sample_rate ); p_input->p_fmt->i_sample_rate );
...@@ -416,7 +421,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -416,7 +421,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
switch( p_stream->i_fourcc ) switch( p_stream->i_fourcc )
{ {
case VLC_FOURCC( 's', 'u','b', 't' ): case VLC_FOURCC( 's', 'u','b', 't' ):
memcpy( p_stream->oggds_header.stream_type, "text ", 8 ); memcpy( p_stream->oggds_header.stream_type, "text", 4 );
msg_Dbg( p_mux, "subtitles stream" ); msg_Dbg( p_mux, "subtitles stream" );
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* transcode.c * transcode.c
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: transcode.c,v 1.37 2003/10/09 09:39:16 gbazin Exp $ * $Id: transcode.c,v 1.38 2003/10/09 11:48:41 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -1361,7 +1361,7 @@ static void transcode_video_ffmpeg_close ( sout_stream_t *p_stream, sout_stream_ ...@@ -1361,7 +1361,7 @@ static void transcode_video_ffmpeg_close ( sout_stream_t *p_stream, sout_stream_
if( id->p_encoder ) if( id->p_encoder )
{ {
/* External encoding */ /* External encoding */
module_Unneed( p_stream, id->p_encoder->p_module ); module_Unneed( id->p_encoder, id->p_encoder->p_module );
vlc_object_destroy( id->p_encoder->p_module ); vlc_object_destroy( id->p_encoder->p_module );
} }
else if( id->b_enc_inited ) else if( id->b_enc_inited )
......
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