/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
#include <vlc/vlc.h>
#include <vlc_demux.h>
#include <vlc_codec.h>
-#include <vlc_meta.h>
+#include <vlc_input.h>
#define MPGA_PACKET_SIZE 1024
vlc_bool_t b_forced = VLC_FALSE;
uint32_t header;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
module_t *p_id3;
block_t *p_block_in, *p_block_out;
- if( p_demux->psz_path )
- {
- int i_len = strlen( p_demux->psz_path );
- if( i_len > 4 && !strcasecmp( &p_demux->psz_path[i_len - 4], ".mp3" ) )
- {
- b_forced = VLC_TRUE;
- }
- }
+ if( demux2_IsPathExtension( p_demux, ".mp3" ) )
+ b_forced = VLC_TRUE;
if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
if( !b_ok && !p_demux->b_force ) return VLC_EGENERIC;
}
- STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+ DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
memset( p_sys, 0, sizeof( demux_sys_t ) );
p_sys->p_es = 0;
p_sys->b_start = VLC_TRUE;
if( HeaderCheck( header ) )
{
int i_xing, i_skip;
- uint8_t *p_xing;
+ const uint8_t *p_xing;
if( ( i_xing = stream_Peek( p_demux->s, &p_xing, 1024 ) ) < 21 )
return VLC_SUCCESS; /* No header */
else
p_sys->b_initial_sync_failed = VLC_FALSE;
- p_sys->p_packetizer->fmt_out.b_packetized = VLC_TRUE;
- p_sys->p_es = es_out_Add( p_demux->out,
- &p_sys->p_packetizer->fmt_out);
p_sys->i_bitrate_avg = p_sys->p_packetizer->fmt_out.i_bitrate;
if( p_sys->i_xing_bytes && p_sys->i_xing_frames &&
module_Unneed( p_demux, p_id3 );
}
+ /* */
+ p_sys->p_packetizer->fmt_out.b_packetized = VLC_TRUE;
+ vlc_audio_replay_gain_MergeFromMeta( &p_sys->p_packetizer->fmt_out.audio_replay_gain,
+ p_sys->meta );
+ p_sys->p_es = es_out_Add( p_demux->out,
+ &p_sys->p_packetizer->fmt_out);
return VLC_SUCCESS;
}