[Live-devel] MP3 file plays only the first 6 sec and restart
Hsien Hwee
light_bulb_85 at yahoo.com.sg
Sun Jun 28 10:30:34 PDT 2009
I have merge the testMPEG1or2AudioVideoStreamer.cpp and testMP3Streamer.cpp
into an application.
When I select a .mpg file, it works without any problem at the receiver (a
VLC player), it plays the whole file and loop again.
but when I select a .mp3, it only plays the first 6 second and it loop again
without finishing the whole file.
This is my code for the .mp3 file
FramedSource* audioSource;
RTPSink* audioSink;
// Open the file as a 'MP3 file source':
MP3FileSource* MP3file = MP3FileSource::createNew(*env, file);
// Create a framer for audio Stream:
audioSource = MPEG1or2AudioStreamFramer::createNew(*env, MP3file);
//start playing each sink
audioSink->startPlaying(*audioSource, afterPlaying, NULL);
void afterPlaying(void* clientData) {
if (audioSource->isCurrentlyAwaitingData()) return;
audioSink->stopPlaying();
// End this loop by closing the current source:
Medium::close(audioSource);
// And start another loop:
play();
}
What might be the problem?
Regards,
Hsien Hwee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20090629/bf89122e/attachment-0001.html>
More information about the live-devel
mailing list