[vlc-commits] stats: eliminate useless CloseDecoder 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:20:19 2013 +0200| [7de1884e740218a657c41f31bc76786ab582e5a7] | committer: Rémi Denis-Courmont
stats: eliminate useless CloseDecoder callback
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7de1884e740218a657c41f31bc76786ab582e5a7
---
modules/misc/stats/decoder.c | 58 +++++++++++++-----------------------------
modules/misc/stats/stats.c | 2 +-
modules/misc/stats/stats.h | 1 -
3 files changed, 19 insertions(+), 42 deletions(-)
diff --git a/modules/misc/stats/decoder.c b/modules/misc/stats/decoder.c
index 9039371..f1a5da5 100644
--- a/modules/misc/stats/decoder.c
+++ b/modules/misc/stats/decoder.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,38 +30,6 @@
#include "stats.h"
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block );
-
-/*****************************************************************************
- * OpenDecoder: Open the decoder
- *****************************************************************************/
-int OpenDecoder ( vlc_object_t *p_this )
-{
- decoder_t *p_dec = (decoder_t*)p_this;
-
- msg_Dbg( p_this, "opening stats decoder" );
-
- /* Set callbacks */
- p_dec->pf_decode_video = DecodeBlock;
- p_dec->pf_decode_audio = NULL;
- p_dec->pf_decode_sub = NULL;
-
- /* */
- es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_I420 );
- p_dec->fmt_out.video.i_width = 100;
- p_dec->fmt_out.video.i_height = 100;
- p_dec->fmt_out.video.i_sar_num = 1;
- p_dec->fmt_out.video.i_sar_den = 1;
-
- return VLC_SUCCESS;
-}
-
-/****************************************************************************
- * RunDecoder: the whole thing
- ****************************************************************************/
static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
block_t *p_block;
@@ -98,10 +63,23 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return p_pic;
}
-/*****************************************************************************
- * CloseDecoder: decoder destruction
- *****************************************************************************/
-void CloseDecoder ( vlc_object_t *p_this )
+int OpenDecoder ( vlc_object_t *p_this )
{
- msg_Dbg( p_this, "closing stats decoder" );
+ decoder_t *p_dec = (decoder_t*)p_this;
+
+ msg_Dbg( p_this, "opening stats decoder" );
+
+ /* Set callbacks */
+ p_dec->pf_decode_video = DecodeBlock;
+ p_dec->pf_decode_audio = NULL;
+ p_dec->pf_decode_sub = NULL;
+
+ /* */
+ es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_I420 );
+ p_dec->fmt_out.video.i_width = 100;
+ p_dec->fmt_out.video.i_height = 100;
+ p_dec->fmt_out.video.i_sar_num = 1;
+ p_dec->fmt_out.video.i_sar_den = 1;
+
+ return VLC_SUCCESS;
}
diff --git a/modules/misc/stats/stats.c b/modules/misc/stats/stats.c
index 219f112..8de1a78 100644
--- a/modules/misc/stats/stats.c
+++ b/modules/misc/stats/stats.c
@@ -55,7 +55,7 @@ vlc_module_begin ()
set_description( N_("Stats decoder function") )
set_capability( "decoder", 0 )
add_shortcut( "stats" )
- set_callbacks( OpenDecoder, CloseDecoder )
+ set_callbacks( OpenDecoder, NULL )
add_submodule ()
set_section( N_( "Stats demux" ), NULL )
set_description( N_("Stats demux function") )
diff --git a/modules/misc/stats/stats.h b/modules/misc/stats/stats.h
index c1e6d67..160055a 100644
--- a/modules/misc/stats/stats.h
+++ b/modules/misc/stats/stats.h
@@ -26,7 +26,6 @@
*****************************************************************************/
int OpenDecoder ( vlc_object_t * );
-void CloseDecoder ( vlc_object_t * );
int OpenEncoder ( vlc_object_t * );
void CloseEncoder ( vlc_object_t * );
More information about the vlc-commits
mailing list