* speex.c: speex decoder/packetizer/encoder module making use of libspeex.
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: speex.c,v 1.6 2003/12/04 16:49:43 sam Exp $
+ * $Id: speex.c,v 1.9 2004/01/05 13:07:02 zorglub Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc/decoder.h>
+#include "vlc_playlist.h"
#include <ogg/ogg.h>
#include <speex.h>
msg_Err( p_dec, "File encoded with a newer version of Speex" );
return VLC_EGENERIC;
}
- if( p_mode->bitstream_version > p_header->mode_bitstream_version )
+ if( p_mode->bitstream_version > p_header->mode_bitstream_version )
{
msg_Err( p_dec, "File encoded with an older version of Speex" );
return VLC_EGENERIC;
}
-
- msg_Dbg( p_dec, "Speex %d Hz audio using %s mode %s%s",
+
+ msg_Dbg( p_dec, "Speex %d Hz audio using %s mode %s%s",
p_header->rate, p_mode->modeName,
( p_header->nb_channels == 1 ) ? " (mono" : " (stereo",
p_header->vbr ? ", VBR)" : ")" );
decoder_sys_t *p_sys = p_dec->p_sys;
input_info_category_t *p_cat =
- input_InfoCategory( p_input, _("Speex Comment") );
+ input_InfoCategory( p_input, _("Speex comment") );
+ playlist_t *p_playlist = vlc_object_find( p_dec, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
char *p_buf = (char *)p_oggpacket->packet;
SpeexMode *p_mode;
p_mode = speex_mode_list[p_sys->p_header->mode];
input_AddInfo( p_cat, _("Mode"), "%s%s",
p_mode->modeName, p_sys->p_header->vbr ? " VBR" : "" );
+ playlist_AddInfo( p_playlist, -1, _("Speex comment") , _("Mode"), "%s%s",
+ p_mode->modeName, p_sys->p_header->vbr ? " VBR" : "" );
if( p_oggpacket->bytes < 8 )
{
}
input_AddInfo( p_cat, p_buf, "" );
+ playlist_AddInfo( p_playlist, -1, _("Speex comment") , p_buf , "" );
+
+ if( p_playlist ) vlc_object_release( p_playlist );
/* TODO: finish comments parsing */
}
p_block->i_buffer );
p_block->i_dts = p_block->i_pts = p_block->i_length = 0;
block_ChainAppend( &p_chain, p_block );
-
+
p_sys->i_headers = 2;
}
/* Backup the remaining raw samples */
if( i_samples )
{
- memcpy( p_sys->p_buffer, p_buffer + i_samples_delay * 2 *
- p_enc->fmt_in.audio.i_channels,
+ memcpy( p_sys->p_buffer + i_samples_delay * 2 *
+ p_enc->fmt_in.audio.i_channels, p_buffer,
i_samples * 2 * p_enc->fmt_in.audio.i_channels );
}