[vlc-commits] stats: eliminate useless data and callback
Rémi Denis-Courmont
git at videolan.org
Sat Mar 9 15:30:56 CET 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 9 16:21:57 2013 +0200| [3264e6d5b587b0a0ac20a1bd68162d0bc2eb7d1d] | committer: Rémi Denis-Courmont
stats: eliminate useless data and callback
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3264e6d5b587b0a0ac20a1bd68162d0bc2eb7d1d
---
modules/misc/stats/encoder.c | 59 +++++-------------------------------------
modules/misc/stats/stats.c | 2 +-
modules/misc/stats/stats.h | 1 -
3 files changed, 8 insertions(+), 54 deletions(-)
diff --git a/modules/misc/stats/encoder.c b/modules/misc/stats/encoder.c
index 574c8bb..d0bcadf 100644
--- a/modules/misc/stats/encoder.c
+++ b/modules/misc/stats/encoder.c
@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@@ -33,45 +30,6 @@
#include "stats.h"
-/*****************************************************************************
- * encoder_sys_t
- *****************************************************************************/
-struct encoder_sys_t
-{
- int i;
-};
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict );
-static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_abuff );
-
-/*****************************************************************************
- * OpenDecoder: open the dummy encoder.
- *****************************************************************************/
-int OpenEncoder ( vlc_object_t *p_this )
-{
- encoder_t *p_enc = (encoder_t *)p_this;
-
- p_enc->p_sys = malloc(sizeof(encoder_sys_t));
-
- if( !p_enc->p_sys ) return VLC_ENOMEM;
-
- p_enc->p_sys->i = 0;
-
- msg_Dbg( p_this, "opening stats encoder" );
-
- p_enc->pf_encode_video = EncodeVideo;
- p_enc->pf_encode_audio = EncodeAudio;
-
-
- return VLC_SUCCESS;
-}
-
-/****************************************************************************
- * EncodeVideo: the whole thing
- ****************************************************************************/
static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
{
(void)p_pict;
@@ -87,9 +45,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
return p_block;
}
-/****************************************************************************
- * EncodeVideo: the whole thing
- ****************************************************************************/
static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_abuff )
{
(void)p_abuff;
@@ -97,14 +52,14 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_abuff )
return NULL;
}
-
-/*****************************************************************************
- * CloseDecoder: decoder destruction
- *****************************************************************************/
-void CloseEncoder ( vlc_object_t *p_this )
+int OpenEncoder ( vlc_object_t *p_this )
{
encoder_t *p_enc = (encoder_t *)p_this;
- msg_Dbg( p_this, "closing stats encoder" );
- free( p_enc->p_sys );
+ msg_Dbg( p_this, "opening stats encoder" );
+
+ p_enc->pf_encode_video = EncodeVideo;
+ p_enc->pf_encode_audio = EncodeAudio;
+
+ return VLC_SUCCESS;
}
diff --git a/modules/misc/stats/stats.c b/modules/misc/stats/stats.c
index 8de1a78..40b8e3e 100644
--- a/modules/misc/stats/stats.c
+++ b/modules/misc/stats/stats.c
@@ -49,7 +49,7 @@ vlc_module_begin ()
set_description( N_("Stats encoder function") )
set_capability( "encoder", 0 )
add_shortcut( "stats" )
- set_callbacks( OpenEncoder, CloseEncoder )
+ set_callbacks( OpenEncoder, NULL )
add_submodule ()
set_section( N_( "Stats decoder" ), NULL )
set_description( N_("Stats decoder function") )
diff --git a/modules/misc/stats/stats.h b/modules/misc/stats/stats.h
index 160055a..46169dc 100644
--- a/modules/misc/stats/stats.h
+++ b/modules/misc/stats/stats.h
@@ -28,7 +28,6 @@
int OpenDecoder ( vlc_object_t * );
int OpenEncoder ( vlc_object_t * );
-void CloseEncoder ( vlc_object_t * );
int OpenDemux ( vlc_object_t * );
void CloseDemux ( vlc_object_t * );
More information about the vlc-commits
mailing list