[FFmpeg-devel] [PATCH] MLP/TrueHD decoder

Michael Niedermayer michaelni
Wed Nov 14 03:19:50 CET 2007


Hi

On Mon, Oct 29, 2007 at 10:50:39AM +0100, Ian Caulfield wrote:
> Hi
> 
> On 10/29/07, Michael Niedermayer <michaelni at gmx.at> wrote:
> >
> > On Tue, Oct 23, 2007 at 09:06:18AM +0100, Ian Caulfield wrote:
> > >
> > > The reasoning behind this was that MLP streams are a pain to parse -
> > > most frames contain no sync word, just a length at the start of the
> > > frame. There appears to be no protection against sync word emulation.
> > > Without checking the frame parity nibble, there's no way to tell if
> > > the stream was corrupted and the parser is now out of sync with the
> > > stream - if this happens the parser will just return garbage frame
> > > boundaries until the end of the stream.
> >
> > well then leave that parity check in there
> >
> 
> OK, updated patch addressing your other comments attached.

i really dont like how the parser is implemented, not at all
what about:

if(!in_sync){
    search for sync code, if found set remaining_size to the PREVIOUS packet
    that is up to this sync code
}else if(!remaining_size){
    set remaining_size based on header here
}
if(remaining_size){
    add whats available of remaining_size into our buffer and decrease
    remaining_size accordingly
}else
    add everything we have into the buffer
if(!remaining_size)
    return packet

(and yes with needed parity checks where appropriate)

[...]

> +/** Read a major sync info header - contains high level information about
> + *  the stream - sample rate, channel arrangement etc. Most of this
> + *  information is not actually necessary for decoding, only for playback.
> + */
> +
> +int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, const uint8_t *buf,
> +                           unsigned int buf_size)
> +{

AVClass** log

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071114/51477ad0/attachment.pgp>



More information about the ffmpeg-devel mailing list