On Wed, Nov 02, 2011 at 05:23:03PM +0100, Michael Niedermayer wrote:
On Wed, Nov 02, 2011 at 04:27:40PM +0100, Nicolas George wrote:
Le septidi 7 brumaire, an CCXX, Michael Niedermayer a écrit :
+ CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), + CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), + CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), + CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), + CODEC_ID_XBIN = MKBETAG('X','B','I','N'), + CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
Using tags like that is a good idea; unfortunately, it will make avcodec_get_type fail, because it does not obey the rule it states: - video codecs from 1 to 0xffff, - audio codecs from 0x10000 to 0x16fff, - subtitles codecs from 0x17000 to 0x17fff.
the only use of avcodec_get_type() is mkv_query_codec() which is buggy per design because unknown codecs most likely come with fourcc in codec_tag and have no codec_id entry at all in the enum. Thus theres nothing to use as argument in the query.
And to continue this argument further the correct API would have been to pass a AVCodecContext into query_codec(), this way query not only has the type for cases where no codec_id exists it also knows details like width, height and the profile which can be a factor in whenever its supported [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle