Commit ed9247b2 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg/*: fixed small memleak in chroma plugin.
   Added back missing bitrate setting for video encoding.
parent cee266c9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* chroma.c: chroma conversion using ffmpeg library * chroma.c: chroma conversion using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: chroma.c,v 1.4 2003/11/22 23:39:14 fenrir Exp $ * $Id: chroma.c,v 1.5 2003/11/26 22:12:48 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -191,3 +191,15 @@ static void ChromaConversion( vout_thread_t *p_vout, ...@@ -191,3 +191,15 @@ static void ChromaConversion( vout_thread_t *p_vout,
&src_pic, p_vout->chroma.p_sys->i_src_ffmpeg_chroma, &src_pic, p_vout->chroma.p_sys->i_src_ffmpeg_chroma,
p_vout->render.i_width, p_vout->render.i_height ); p_vout->render.i_width, p_vout->render.i_height );
} }
/*****************************************************************************
* CloseChroma: free the chroma function
*****************************************************************************
* This function frees the previously allocated chroma function
*****************************************************************************/
static void E_(CloseChroma)( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
free( p_vout->chroma.p_sys );
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* encoder.c: video and audio encoder using the ffmpeg library * encoder.c: video and audio encoder using the ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: encoder.c,v 1.9 2003/11/26 13:59:16 gbazin Exp $ * $Id: encoder.c,v 1.10 2003/11/26 22:12:48 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>
...@@ -194,7 +194,6 @@ int E_(OpenEncoder)( vlc_object_t *p_this ) ...@@ -194,7 +194,6 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
else if( p_enc->fmt_in.i_cat == AUDIO_ES ) else if( p_enc->fmt_in.i_cat == AUDIO_ES )
{ {
p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE; p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
p_context->bit_rate = p_enc->fmt_out.i_bitrate;
p_context->sample_rate = p_enc->fmt_in.audio.i_rate; p_context->sample_rate = p_enc->fmt_in.audio.i_rate;
p_context->channels = p_enc->fmt_in.audio.i_channels; p_context->channels = p_enc->fmt_in.audio.i_channels;
p_sys->i_frame_size = p_context->frame_size * 2 * p_context->channels; p_sys->i_frame_size = p_context->frame_size * 2 * p_context->channels;
...@@ -203,6 +202,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this ) ...@@ -203,6 +202,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
} }
/* Misc parameters */ /* Misc parameters */
p_context->bit_rate = p_enc->fmt_out.i_bitrate;
p_context->gop_size = p_enc->i_key_int > 0 ? p_enc->i_key_int : 50; p_context->gop_size = p_enc->i_key_int > 0 ? p_enc->i_key_int : 50;
p_context->max_b_frames = p_context->max_b_frames =
__MIN( p_enc->i_b_frames, FF_MAX_B_FRAMES ); __MIN( p_enc->i_b_frames, FF_MAX_B_FRAMES );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library * ffmpeg.c: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.60 2003/11/22 23:39:14 fenrir Exp $ * $Id: ffmpeg.c,v 1.61 2003/11/26 22:12:48 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>
...@@ -99,7 +99,7 @@ vlc_module_begin(); ...@@ -99,7 +99,7 @@ vlc_module_begin();
/* chroma conversion submodule */ /* chroma conversion submodule */
add_submodule(); add_submodule();
set_capability( "chroma", 50 ); set_capability( "chroma", 50 );
set_callbacks( E_(OpenChroma), NULL ); set_callbacks( E_(OpenChroma), E_(CloseChroma) );
set_description( _("ffmpeg chroma conversion") ); set_description( _("ffmpeg chroma conversion") );
/* encoder submodule */ /* encoder submodule */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ffmpeg.h: decoder using the ffmpeg library * ffmpeg.h: decoder using the ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.h,v 1.29 2003/11/23 20:37:04 gbazin Exp $ * $Id: ffmpeg.h,v 1.30 2003/11/26 22:12:48 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -52,6 +52,7 @@ aout_buffer_t *E_( DecodeAudio ) ( decoder_t *, block_t ** ); ...@@ -52,6 +52,7 @@ aout_buffer_t *E_( DecodeAudio ) ( decoder_t *, block_t ** );
/* Chroma conversion module */ /* Chroma conversion module */
int E_(OpenChroma)( vlc_object_t * ); int E_(OpenChroma)( vlc_object_t * );
void E_(CloseChroma)( vlc_object_t * );
/* Video encoder module */ /* Video encoder module */
int E_(OpenEncoder) ( vlc_object_t * ); int E_(OpenEncoder) ( vlc_object_t * );
......
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