[MPlayer-users] question about demux_ogg.c and audio format types

Sascha Sommer saschasommer at freenet.de
Tue Jul 30 11:27:01 CEST 2002


> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi MPlayer developers,
> 
> a question about libmpdemux/demux_ogg.c, around line 502. The code I
> question is
> 
>         memcpy(buffer,st->subtype,4);
>         buffer[4] = '\0';
> ...
>         sh_a->format =  sh_a->wf->wFormatTag = atoi(buffer);
> 
> This obviously works if the format is PCM (0x0001) but fails for any ID
> bigger than (decimal) 10. Exmple: MP3 has 0x0055 which atoi would
> convert into 55, although the correct decimal value is 85. AC3 (0x2000)
> wouldn't even fit into the four-character subtype array.
> 
> Shouldn't the 'atoi(buffer)' read 'strtol(buffer, (char **)NULL, 16)'
> instead?
> 
> (No, I won't create a patch for that - it's just one simple line with
> one simple change :))
You should send this, better with patch, to dev-eng. I don't think many 
developers are reading this list.

Sascha Sommer




More information about the MPlayer-users mailing list