2008/3/26, Michael Niedermayer <michaelni@gmx.at>:
I do not like generic code full of If(codecA) else
The sync function should return if it has a complete frame or if (maybe) not. That is
flags= FRAME_START | FRAME_END;
You do this in stream_type but this name is totally wrong this is not a stream_type. It is not even constant for a stream. NEVER even think of using a name from the a52* spec, the people who wrote it are idiots. Its a flag indicating the start/end of a frame. And IMHO it should be returned more directly than as a context variable but thats rather minor the name is a major issue. It totally confused me until looked it up in the spec.
Code should be understandable without looking things up in the specs.
Also the "stream_type" has the wrong type (should be enum) and the types used in AAC-AC3 code must be generic types not *AC3 specific types in headers which arent #included.
Ok, what do you think about such a plan: 1. enum AACAC3FrameFlag{ FRAME_COMPLETE, FRAME_START, FRAME_CONTINUATION }; removal of stream_type z AACAC3ParseContext, change of int (*sync)(struct AACAC3ParseContext *hdr_info) to int (*sync)(struct AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) 2.change of stream_type to frame_type 3.change of ff_aac_ac3_parse to make it react correctly to result returned in flag. -- Bartlomiej Wolowiec