[Live-devel] MP3 file stream crashes

Matthew Hale matthew at scansoft.co.za
Thu Sep 14 04:24:18 PDT 2023


Just an update on this bug. It was caused by calling select() on a file
descriptor from a FILE * in the MP3FileSource. On Windows select() can only
be called on sockets so using turnOnBackgroundReadHandling() is not
possible there. I had built this from vcpkg with a msvc compiler.

I have written a custom file reader source which seems to work somewhat but
has 2 issues.

1. I think the file reading is slow, sometimes the stream works but most of
the time VLC closes the stream because packets arrive late. I assume I'll
need a thread to buffer the file data to fix this.

2. After reading the EOF I call handleClosure, which is causing VLC to not
play the end of the stream. It is clipping off the last part of the audio.
If I do nothing instead it plays till the end but then doesn't close the
stream and fails having detected a dead input. As far as I'm aware the
MPEG1or2AudioRTPSink is supposed to stay open to finish sending the rest of
the data but this does not seem to be the case.


Kind regards,



*Matthew Hale*


*Web: www.scansoft.co.za <http://www.scansoft.co.za/>*
*Tel:  +27 21 913 8664*

*Cell: +27 76 118 4748*


On Wed, Aug 30, 2023 at 3:02 PM Matthew Hale <matthew at scansoft.co.za> wrote:

> Not really an option for us at the moment. Thanks for the help.
>
>
> Kind regards,
>
>
>
> *Matthew Hale*
>
>
> *Web: www.scansoft.co.za <http://www.scansoft.co.za/>*
> *Tel:  +27 21 913 8664*
>
> *Cell: +27 76 118 4748*
>
>
> On Wed, Aug 30, 2023 at 2:55 PM Ross Finlayson <finlayson at live555.com>
> wrote:
>
>>
>>
>> > On Aug 30, 2023, at 4:16 AM, Matthew Hale <matthew at scansoft.co.za>
>> wrote:
>> >
>> > The attached MP3 also does not work.
>>
>> Then I can’t explain this - sorry.  Presumably the error you are seeing
>> comes about from the fact that you are trying to build/run the code on
>> Windows.  I don’t recommend this; pretty much nobody these days develops
>> systems software like this on Windows (just about everybody now uses
>> Unix-based systems (Linux, FreeBSD, MacOS) for serious software
>> development).
>>
>> However, if you insist on using Windows, you might be able to build the
>> code in the “Cygwin” environment <https://en.wikipedia.org/wiki/Cygwin>
>> by doing:
>> cd live; ./genMakefiles cygwin; make
>>
>>
>> Ross Finlayson
>> Live Networks, Inc.
>> http://www.live555.com/
>>
>>
>> _______________________________________________
>> live-devel mailing list
>> live-devel at lists.live555.com
>> http://lists.live555.com/mailman/listinfo/live-devel
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230914/252a2cd7/attachment.htm>


More information about the live-devel mailing list