[smpeg] SMPEG threading, SMPEG constructors

Doru-Catalin Togea doru-cat at student.matnat.uio.no
Wed Jan 8 04:46:48 EST 2003

On Tue, 7 Jan 2003, Ryan C. Gordon wrote:

> > mpeg = SMPEG_new_descr(playBuffer[0], &info, use_audio);
> >
> > when will it return control to my programme?
> None of the SMPEG functions block...you should regain control immediately.

Hmmm! Then something could be seriously wrong with my SMPEG installation.
I don't remember getting any error messages when installing though. I am
using SMPEG on a RedHat 7.3 machine.

I have a programme which compiles and plays MPEG files when I use the
file-name-pointer constructor (playing from files on disk)

	mpeg = SMPEG_new(argv[i], &info, use_audio);

My new programme, on which I am working now, blocks when using the

	mpeg = SMPEG_new_descr(playBuffer[0], &info, use_audio);


playBuffer is a pipe, initialized like this:

int playBuffer[2];

When the process blocks I can only kill it with the -9 option. Ctr+C
doesn't work.

Another surprizing element is that I have added a couple of printf
statements in the following routines:

	SMPEG_new_descr(...) from the smpeg.cpp file,
	MPEG::MPEG(MPEG_FD, use_audio) from MPEG.cpp (this constructor,
		 is called by SMPEG_new_descr(...)

but they have no effect. No output is printed to the screen.

Of course, I recompiled the library with "make all", and
reinstalled it with "make install", both operations as root, and I have
recompiled my programme with the altered libraries.

Is SMPEG suppressing or redirecting output from stderr?

This is my quest:

I am streaming MPEG and I need a fine-grained control mechanism which
allows me to feed the MPEG player with chunks of data as they arrive. Data
arrives as char *s. Just calling some fancy streaming library which
pluggs in directly into some sockets and does all work behind the scene is
not good enough.

Is the SMPEG_new_descr(...); the right choice? Any alternatives?

Am I on the right track by using a pipe? My plan is to have the SMPEG
player "read" from the pipe, while my programme continuosly writes data
to it.

Can anyone please help me out?



	<<<< ================================== >>>>
	<<     We are what we repeatedly do.      >>
	<<  Excellence, therefore, is not an act  >>
	<<             but a habit.               >>
	<<<< ================================== >>>>

More information about the smpeg mailing list