/*****************************************************************************
* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <vlc_demux.h>
#include <vlc_meta.h>
/* Packetizer */
decoder_t *p_packetizer;
+
vlc_meta_t *p_meta;
audio_replay_gain_t replay_gain;
static int Open( vlc_object_t * p_this )
{
demux_t *p_demux = (demux_t*)p_this;
- module_t *p_id3;
demux_sys_t *p_sys;
const byte_t *p_peek;
uint8_t *p_streaminfo;
{
if( p_sys->p_packetizer->fmt_in.p_extra )
free( p_sys->p_packetizer->fmt_in.p_extra );
- vlc_object_destroy( p_sys->p_packetizer );
+ vlc_object_release( p_sys->p_packetizer );
msg_Err( p_demux, "cannot find flac packetizer" );
return VLC_EGENERIC;
}
- /* Parse possible id3 header */
- input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
- if( p_input )
- {
- if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
- {
- p_demux->p_private = malloc( sizeof( demux_meta_t ) );
- if( !p_demux->p_private )
- {
- vlc_object_release( p_input );
- return VLC_ENOMEM;
- }
- if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
- {
- demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
- vlc_meta_t *p_meta = p_demux_meta->p_meta;
-
- if( !p_sys->p_meta )
- {
- p_sys->p_meta = p_meta;
- }
- else if( p_meta )
- {
- vlc_meta_Merge( p_sys->p_meta, p_meta );
- vlc_meta_Delete( p_meta );
- }
- p_demux->p_private = NULL;
- module_Unneed( p_demux, p_id3 );
- int i;
- for( i = 0; i < p_demux_meta->i_attachments; i++ )
- TAB_APPEND_CAST( (input_attachment_t**),
- p_sys->i_attachments, p_sys->attachments,
- p_demux_meta->attachments[p_demux_meta->i_attachments] );
- TAB_CLEAN( p_demux_meta->i_attachments,
- p_demux_meta->attachments );
- }
- free( p_demux->p_private );
- }
- vlc_object_release( p_input );
- }
-
if( p_sys->i_cover_idx < p_sys->i_attachments )
{
char psz_url[128];
free( p_sys->p_packetizer->fmt_in.p_extra );
/* Delete the decoder */
- vlc_object_destroy( p_sys->p_packetizer );
+ vlc_object_release( p_sys->p_packetizer );
if( p_sys->p_meta )
vlc_meta_Delete( p_sys->p_meta );
free( p_sys );
vlc_meta_Merge( p_meta, p_demux->p_sys->p_meta );
return VLC_SUCCESS;
}
+ else if( i_query == DEMUX_HAS_UNSUPPORTED_META )
+ {
+ vlc_bool_t *pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
+ *pb_bool = VLC_TRUE;
+ return VLC_SUCCESS;
+ }
else if( i_query == DEMUX_GET_LENGTH )
{
int64_t *pi64 = (int64_t*)va_arg( args, int64_t * );
{
/* generic (PERFORMER/LICENSE/ORGANIZATION/LOCATION/CONTACT/ISRC,
* undocumented tags and replay gain ) */
- audio_replay_gain_t *r = &p_sys->replay_gain;
char *p = strchr( psz, '=' );
*p++ = '\0';
vlc_meta_AddExtra( p_sys->p_meta, psz, p );