[Live-devel] mp3 streamer doubt

Woods woods.biz at gmail.com
Tue Jul 7 01:43:02 PDT 2009


Dear Experts,

I have a doubt on my MP3 Streamer.

This streamer is based on testMP3Streamer code, but I changed to use
BasicUDPSink. And it works fine.

As you know, in play() function, the code was like:

source = MP3FileSource::createNew(*env,fileName);



But after I slightly changed my code as follows:

MP3FileSource *mp3fileSource = MP3FileSource::createNew(*env,fileName);
MPEG2TransportStreamFromESSource *m2ts =
MPEG2TransportStreamFromESSource::createNew(*env);
m2ts->addNewAudioSource(mp3fileSource,1);
source = MPEG2TransportStreamFramer::createNew(*env, m2ts);

What I want is streaming mp3 within mpeg2ts / udp. For the first round of
play, this is perfect. But, when mp3 file reaches end, the stop() and play()
functions are called in sequence, the program segment fault when it starts
to playing again.

But if I comment the Medium::close() in stop() function, (I do this only for
testing purpose), I can repeatedly stream that mp3 file.

After testing in different ways, I suspect there is something wrong when I
use MPEG2TransportStreamFromESSource, especially when I delete it. But
according to my understanding, in my code, the delete operations should be:

stop() function --> Medium::close(source) --> delete
MPEG2TransportStreamFramer --> delete MPEG2TransportStreamFromESSource -->
delete MP3FileSource. It looks OK! But what is wrong?

Could anyone give me a suggestion?

Thanks


-- 
Woods
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20090707/f7cfe993/attachment-0001.html>


More information about the live-devel mailing list