Commit 8331d363 authored by Gildas Bazin's avatar Gildas Bazin

* include/vlc_codec.h, modules/codec/ffmpeg/encoder.c, modules/stream_out/transcode.c: tell the encoder to respect the aspect ratio of the input.
* modules/gui/wxwindows/preferences_widgets.cpp: compilation fix.
* src/misc/configuration.c: use strtol() instead of atoi().
parent 48190fd3
......@@ -2,7 +2,7 @@
* vlc_codec.h: codec related structures
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
* $Id: vlc_codec.h,v 1.2 2003/10/27 01:04:38 gbazin Exp $
* $Id: vlc_codec.h,v 1.3 2003/11/05 18:59:01 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -94,6 +94,7 @@ struct encoder_t
/* FIXME: move these to the ffmpeg encoder */
int i_frame_rate;
int i_frame_rate_base;
int i_aspect;
int i_key_int;
int i_b_frames;
int i_vtolerance;
......
......@@ -2,7 +2,7 @@
* encoder.c: video and audio encoder using the ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: encoder.c,v 1.4 2003/11/05 17:46:21 gbazin Exp $
* $Id: encoder.c,v 1.5 2003/11/05 18:59:01 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -150,7 +150,17 @@ int E_(OpenVideoEncoder)( vlc_object_t *p_this )
p_context->bit_rate = p_enc->i_bitrate;
p_context->frame_rate = p_enc->i_frame_rate;
#if LIBAVCODEC_BUILD >= 4662
p_context->frame_rate_base= p_enc->i_frame_rate_base;
#endif
#if LIBAVCODEC_BUILD >= 4687
p_context->sample_aspect_ratio =
av_d2q( p_enc->i_aspect * p_context->height / p_context->width /
VOUT_ASPECT_FACTOR, 255 );
#else
p_context->aspect_ratio = ((float)p_enc->i_aspect) / VOUT_ASPECT_FACTOR );
#endif
p_context->gop_size = p_enc->i_key_int >= 0 ? p_enc->i_key_int : 50;
p_context->max_b_frames =
......
......@@ -2,7 +2,7 @@
* preferences_widgets.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences_widgets.cpp,v 1.12 2003/11/05 17:46:21 gbazin Exp $
* $Id: preferences_widgets.cpp,v 1.13 2003/11/05 18:59:01 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
......@@ -442,7 +442,7 @@ wxString StringListConfigControl::GetPszValue()
int selected = combo->GetSelection();
if( selected != -1 )
{
return (char *)combo->GetClientData( selected );
return wxU((char *)combo->GetClientData( selected ));
}
return wxString();
}
......
......@@ -2,7 +2,7 @@
* transcode.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: transcode.c,v 1.48 2003/10/30 12:01:01 gbazin Exp $
* $Id: transcode.c,v 1.49 2003/11/05 18:59:01 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -988,6 +988,16 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
#if LIBAVCODEC_BUILD >= 4662
id->p_encoder->i_frame_rate_base= id->ff_dec_c->frame_rate_base;
#endif
#if LIBAVCODEC_BUILD >= 4687
id->p_encoder->i_aspect = VOUT_ASPECT_FACTOR *
( av_q2d(id->ff_dec_c->sample_aspect_ratio) *
id->ff_dec_c->width / id->ff_dec_c->height );
#else
id->p_encoder->i_aspect = VOUT_ASPECT_FACTOR *
id->ff_dec_c->aspect_ratio;
#endif
}
else
{
......
......@@ -2,7 +2,7 @@
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: configuration.c,v 1.68 2003/11/05 17:57:29 gbazin Exp $
* $Id: configuration.c,v 1.69 2003/11/05 18:59:01 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -815,7 +815,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
case CONFIG_ITEM_INTEGER:
if( !*psz_option_value )
break; /* ignore empty option */
p_item->i_value = atoi( psz_option_value);
p_item->i_value = strtol( psz_option_value, 0, 0 );
#if 0
msg_Dbg( p_this, "option \"%s\", value %i",
p_item->psz_name, p_item->i_value );
......@@ -1387,7 +1387,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
config_PutPsz( p_this, psz_name, optarg );
break;
case CONFIG_ITEM_INTEGER:
config_PutInt( p_this, psz_name, atoi(optarg));
config_PutInt( p_this, psz_name, strtol(optarg, 0, 0));
break;
case CONFIG_ITEM_FLOAT:
config_PutFloat( p_this, psz_name, (float)atof(optarg) );
......@@ -1443,7 +1443,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
else
{
config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name,
atoi(optarg) );
strtol(optarg, 0, 0) );
}
break;
case CONFIG_ITEM_BOOL:
......
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