EOF of a mpeg stream

jorgefm at cirsa.com jorgefm at cirsa.com
Thu Dec 2 11:22:20 EST 2004

Is there some way to know when a mpeg has been played totally??
I need to throw a notification when this kind of event occurs.

I've modified 'smpeg.h'

/* EOF of the MPEG stream?  */
extern DECLSPEC int SMPEG_eof( SMPEG* mpeg );

and 'smpeg.cpp'

/* Is it the EOF? */
int SMPEG_eof( SMPEG* mpeg )
    if ( mpeg->obj ) {
        if(mpeg->obj->audiostream != NULL && mpeg->obj->videostream != NULL
            return (int)(mpeg->obj->audiostream-> eof() &&
mpeg->obj->videostream-> eof());
        else if(mpeg->obj->audiostream != NULL )
            return (int)(mpeg->obj->audiostream-> eof());
        else if(mpeg->obj->videostream != NULL )
            return (int)(mpeg->obj->videostream-> eof());
    return 0;

to implement this but i'm not sure to be the correct way because
i get 'true' near the real end of the mpeg, when the mpeg has audio.

Any comment??


More information about the smpeg mailing list