]> git.sesse.net Git - vlc/blobdiff - modules/codec/shine/shine_mod.c
Fix MS ADPCM in w64 files.
[vlc] / modules / codec / shine / shine_mod.c
index 94de78ef7732300be190b7bbe1985be8b953b999..b5bdb02d7cc6976476195813275439b8c12aaa68 100644 (file)
@@ -74,7 +74,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     encoder_sys_t *p_sys;
 
     /* FIXME: what about layers 1 and 2 ? shine is an 'MP3' encoder */
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','3',' ') ||
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_MP3 ||
         p_enc->fmt_out.audio.i_channels > 2 )
         return VLC_EGENERIC;
 
@@ -96,10 +96,9 @@ static int OpenEncoder( vlc_object_t *p_this )
              p_enc->fmt_out.i_bitrate, p_enc->fmt_out.audio.i_rate,
              p_enc->fmt_out.audio.i_channels );
 
-    p_sys = p_enc->p_sys = malloc( sizeof( encoder_sys_t ) );
+    p_enc->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) );
     if( !p_sys )
         return VLC_ENOMEM;
-    memset( p_sys, 0, sizeof( encoder_sys_t ) );
 
     if( !( p_sys->p_fifo = block_FifoNew() ) )
     {
@@ -111,6 +110,7 @@ static int OpenEncoder( vlc_object_t *p_this )
         p_enc->fmt_out.audio.i_channels, p_enc->fmt_out.i_bitrate / 1000 );
 
     p_enc->pf_encode_audio = EncodeFrame;
+    p_enc->fmt_out.i_cat = AUDIO_ES;
 
     return VLC_SUCCESS;
 }
@@ -181,13 +181,14 @@ buffered:
 
 static block_t *EncodeFrame( encoder_t *p_enc, aout_buffer_t *p_block )
 {
-    encoder_sys_t *p_sys = (encoder_sys_t *)p_enc->p_sys;
     block_t *p_pcm_block;
     block_t *p_chain = NULL;
     unsigned int i_samples = p_block->i_nb_bytes >> 2 /* s16l stereo */;
     mtime_t start_date = p_block->start_date;
     start_date -= (mtime_t)i_samples * (mtime_t)1000000 / (mtime_t)p_enc->fmt_out.audio.i_rate;
 
+    VLC_UNUSED(p_enc);
+
     do {
         p_pcm_block = GetPCM( p_enc, p_block );
         if( !p_pcm_block )