]> git.sesse.net Git - vlc/commitdiff
* include/vlc_codec.h, modules/codec/ffmpeg/encoder.c, modules/stream_out/transcode...
authorGildas Bazin <gbazin@videolan.org>
Wed, 5 Nov 2003 18:59:01 +0000 (18:59 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 5 Nov 2003 18:59:01 +0000 (18:59 +0000)
* modules/gui/wxwindows/preferences_widgets.cpp: compilation fix.
* src/misc/configuration.c: use strtol() instead of atoi().

include/vlc_codec.h
modules/codec/ffmpeg/encoder.c
modules/gui/wxwindows/preferences_widgets.cpp
modules/stream_out/transcode.c
src/misc/configuration.c

index 466e1060edba92b7d137cafab07cca136a1eba91..5acb0746ee8c1a979e7cfcb3481e9efc0a0b6b13 100644 (file)
@@ -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;
index 82c4f67efb8428ec41f7ad877712a6a0ddd96fa3..230833988f24b372a0a481448eb76f6132897248 100644 (file)
@@ -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 =
index 56667a630bde8a19b2cdab62d44dd5fe33ae45c4..4a47dcaadf8fdccc9270a18235669986c49a9543 100644 (file)
@@ -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();
 }
index 824bd401271ebf5a99985dff1cfd10540f39be07..a693e403478bd15cabb9a19f3ba2c342a4c0f4bf 100644 (file)
@@ -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
     {
index 8f153257f8b1d46dda3ebf7ae3e2fd5fe2ba4f48..ebeeeedb3a5836cd78bf9bc66fc82cdc75b939db 100644 (file)
@@ -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: