Problem with the MPEG1 video format

Hi :) !

The sample code is given :

......................
......................
CodecInfo ci;
OSErr err;
err = GetCodecInfo (&ci, cType, 0); // cType = 1831958048 ( MPEG1 video format )
if( err != noErr ) err == -8961 // noCodecErr ???
ATLASSERT(0); // Error !!!
......................
......................

where is the mistake? What should i do?
  • [quote=Vitaly]
    err = GetCodecInfo (&ci, cType, 0); // cType = 1831958048 ( MPEG1 video format )please review the Codec Identifier constants and be sure you have a way to cast 1831958048 to something on this list.
    [quote=Vitaly]if( err != noErr ) err == -8961 // noCodecErr ???
    -8961 does equal noCodecErr. why you would ever want to hard code err = anything other than what GetCodecInfo returns is beyond me. also, you're using a comparison operator (==) rather than an assignment operator (=), and you're missing a semicolon (;).
    [quote=Vitaly]ATLASSERT(0); // Error !!!
    ATLASSERT(false) will always fail. if you hard code your assertion, there's no point in asserting. maybe what you meant was ATLASSERT(err == noErr);?


    on a side note, it is way past time to give up ATL. COM is quickly dying. the Visual Studio Express Editions are an excellent way to get into the .NET world, and even if you stay with C++, you'll get IntelliSense, which should go a long way in helping with these elementary mistakes.
  • Sorry :) !

    Source code must be such :

    [CODE]......................
    ......................
    CodecInfo ci;
    OSErr err;
    err = GetCodecInfo (&ci, cType, 0); // cType = 1831958048 ( MPEG1 video format )
    if( err != noErr ) // err == -8961 noCodecErr ???
    ATLASSERT(0);
    ......................
    ......................[/CODE]

    I open different types of MOV-files.
    When сType == 1986618469 (png, h261, Photo JPEG and other video formats ) - No Error!

    If cType == 1831958048 (MPEG1 video format ) - Error!

    Why? :dunno: