[
http://dev.sourcefabric.org/browse/LS-646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=29647#action_29647
]
Samuel Mimram commented on LS-646:
----------------------------------
In order to test, it's easy to use the example file Martin mentioned above and
look for outputs such as
test.mp3 opened for writing was closed
(when closing the file the program indicates whether it was opened for writing
or not).
The culprit is taglib. Here is the call chain:
1. When opening a file with taglib, we usually call FileRef::create
(fileref.cpp)
2. It will call a proper opening function. For instance MPEG::File::File for
mp3 (mpegfile.cpp)
3. This function will call TagLib::File(file) (tfile.cpp) in order to open the
file
4. It will do IOStream *stream = new FileStream(fileName); in order to create a
stream.
5. The function FileStream (tfilestream.cpp) takes two argments: the file name,
and wether the file should be opened read-only (and *by default* it's false!,
see tfilestream.h). When the second argument is false (default) it will try to
open with writing rights.
I therefore see two possible solutions:
1. report a bug to taglib
2. Bypass step 1 above (it's only a check based on the file extension), create
ourselve the stream from the file without writing rights, and call
MPEG::File::File (or whatever suitable constructor) with the stream (and not
the filename) as argument.
> Have taglib open files in read-only mode
> ----------------------------------------
>
> Key: LS-646
> URL: http://dev.sourcefabric.org/browse/LS-646
> Project: Liquidsoap
> Issue Type: Bug
> Components: ocaml-taglib
> Reporter: Samuel Mimram
>
> Martin reported this bug on the ML:
> I have the following command line :
> liquidsoap -c "output.dummy(audio_to_stereo(single('avicii.mp3')))"
> and simple c program that uses inotify to monitor accesses to a directory
> (available here:
> http://darkeside.blogspot.ca/2007/12/linux-inotify-example.html)
> This is all a very simple test environment set up to recreate what we are
> currently experiencing.
> So whenever I run the above Liquidsoap command, the inotify program reports
> the file was opened in read/write mode. If I take away write permissions on
> this file, then Liquidsoap opens it in read mode.
> This opening in write mode is a problem for us, because we are listening for
> these events with our media-monitor to ensure the file's metadata are in sync
> with Airtime's database, and introduces a few complications
> (http://dev.sourcefabric.org/browse/CC-4343).
> Is there a reason for this behaviour, or can we change it?
> Martin
> P.S. Sorry for the possibly overly-verbose email :)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://dev.sourcefabric.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Savonet-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-devl