Problem with the MPEG1 video format

VitalyVitaly Registered User
edited January 2008 in Hog 4 Tips and Tricks
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?

Comments

  • quinnquinn Registered User
    edited January 2008
    Vitaly wrote:
    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.
    Vitaly wrote:
    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 (;).
    Vitaly wrote:
    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.
  • VitalyVitaly Registered User
    edited January 2008
    Sorry :) !

    Source code must be such :
    ......................
    ......................
    CodecInfo ci;
    OSErr err;
    err = GetCodecInfo (&ci, cType, 0); // cType = 1831958048 ( MPEG1 video format )
    if( err != noErr ) // err == -8961 noCodecErr ???
       ATLASSERT(0); 
    ......................
    ......................
    

    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:
Sign In or Register to comment.