X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Faiff.c;h=724e21b732f1c6e8ab8be5397e691023e0fa461d;hb=bfffe8bfbce5ec499f4ab04f89c18b4b3752df93;hp=a330823ac585eb682435ca00f01c95d49c9088cf;hpb=d367c2f58e4bf09e07c5a57cda689fc01b29a7f5;p=vlc diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c index a330823ac5..724e21b732 100644 --- a/modules/demux/aiff.c +++ b/modules/demux/aiff.c @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** @@ -113,10 +113,7 @@ static int Open( vlc_object_t *p_this ) stream_Read( p_demux->s, NULL, 12 ); /* Fill p_demux field */ - p_demux->pf_demux = Demux; - p_demux->pf_control = Control; - p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); - + STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys; es_format_Init( &p_sys->fmt, UNKNOWN_ES, 0 ); p_sys->i_time = 1; p_sys->i_ssnd_pos = -1; @@ -125,22 +122,14 @@ static int Open( vlc_object_t *p_this ) { uint32_t i_size; - if( stream_Peek( p_demux->s, &p_peek, 8 ) < 8 ) - { - msg_Dbg( p_demux, "cannot peek()" ); - goto error; - } + CHECK_PEEK_GOTO( p_peek, 8 ); i_size = GetDWBE( &p_peek[4] ); msg_Dbg( p_demux, "chunk fcc=%4.4s size=%d", p_peek, i_size ); if( !strncmp( (char *)&p_peek[0], "COMM", 4 ) ) { - if( stream_Peek( p_demux->s, &p_peek, 18 + 8 ) < 18 + 8 ) - { - msg_Dbg( p_demux, "cannot peek()" ); - goto error; - } + CHECK_PEEK_GOTO( p_peek, 18+8 ); es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 't', 'w', 'o', 's' ) ); p_sys->fmt.audio.i_channels = GetWBE( &p_peek[8] ); p_sys->fmt.audio.i_bitspersample = GetWBE( &p_peek[14] ); @@ -151,12 +140,7 @@ static int Open( vlc_object_t *p_this ) } else if( !strncmp( (char *)&p_peek[0], "SSND", 4 ) ) { - if( stream_Peek( p_demux->s, &p_peek, 8 + 8 ) < 8 + 8 ) - { - msg_Dbg( p_demux, "cannot peek()" ); - goto error; - } - + CHECK_PEEK_GOTO( p_peek, 8+8 ); p_sys->i_ssnd_pos = stream_Tell( p_demux->s ); p_sys->i_ssnd_size = i_size; p_sys->i_ssnd_offset = GetDWBE( &p_peek[8] );