open file by file descriptor

*nix specific usage questions
mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

open file by file descriptor

Postby mangup » 12 Jul 2019 02:09

I discovered that it is implemented, but does not work for me.
How to do it properly?

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: open file by file descriptor

Postby unidan » 16 Jul 2019 08:59

Hi, according to the tests, it works with fd://thefiledescriptornumber, like fd://0 for stdin.
What do you mean by it doesn't not work ?

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: open file by file descriptor

Postby mangup » 16 Jul 2019 11:17

open file, write data, get fd and put it to input_SlaveSourceAdd() instead of file path

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: open file by file descriptor

Postby unidan » 16 Jul 2019 11:23

And what are the logs ?

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: open file by file descriptor

Postby mangup » 16 Jul 2019 11:58

[00007f61193227e8] main generic debug: no access modules matched
[000055e2e5388270] main input warning: failed to add fd://4134900864 as slave
[000055e2e5388270] main input debug: failed input_SlaveSourceAdd

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: open file by file descriptor

Postby unidan » 16 Jul 2019 13:01

It's in the same access as file access so you probably have an issue with your modules instead

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: open file by file descriptor

Postby mangup » 16 Jul 2019 16:19

Sorry, I did not catch your idea.
I can create file, write data, close it and pass file path to input_SlaveSourceAdd(..., "file:///path", ...) and it works.
But: open file, write data, get fd and call input_SlaveSourceAdd(..., "fd:///<fd-string>", ...) does not work.

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: open file by file descriptor

Postby unidan » 16 Jul 2019 18:19

Actually, fd://4134900864 looks like a wrong file descriptor, as the default limit is really lower that that and it's bigger than INT_MAX. What did you do ? Can you scan the file descriptor from the process when doing this ?

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: open file by file descriptor

Postby mangup » 17 Jul 2019 20:53

Now I've fixed fd. it is 33 :)
But still faild to load data from open file via fd - no module is selected inside vlc_stream_FilterNew() function during "priv->module = module_need(s, "stream_filter", psz_stream_filter, true);" call.

#0 0x00007ffff708503b in vlc_stream_FilterNew (p_source=0x7fff74c65280, psz_stream_filter=0x7fff75b45d80 "prefetch,cache") at input/stream_filter.c:78
#1 0x00007ffff708517b in stream_FilterChainNew (p_source=0x7fff74c65280, psz_chain=0x7ffff71039c0 "prefetch,cache") at input/stream_filter.c:117
#2 0x00007ffff70451d7 in stream_AccessNew (parent=0x5555558445d0, input=0x5555558445d0, out=0x7fff74000fc0, preparsing=false, url=0x7fff76196440 "fd://33") at input/access.c:344
#3 0x00007ffff706d688 in InputDemuxNew (p_input=0x5555558445d0, p_source=0x7fff74c66520, url=0x7fff76196440 "fd://33", psz_demux=0x7ffff710aed4 "subtitle", psz_anchor=0x7ffff710a262 "") at input/input.c:2534
#4 0x00007ffff706dccb in InputSourceNew (p_input=0x5555558445d0, psz_mrl=0x7fff74cdd730 "fd://33", psz_forced_demux=0x7ffff710aed4 "subtitle", b_in_can_fail=true) at input/input.c:2678
#5 0x00007ffff7070b36 in input_SlaveSourceAdd (p_input=0x5555558445d0, i_type=SLAVE_TYPE_SPU, psz_uri=0x7fff74cdd730 "fd://33", i_flags=7) at input/input.c:4002
#6 0x00007ffff706c376 in Control (p_input=0x5555558445d0, i_type=32, param=...) at input/input.c:2104
#7 0x00007ffff706858a in MainLoop (p_input=0x5555558445d0, b_interactive=true) at input/input.c:778
#8 0x00007ffff70679ff in Run (data=0x5555558445d0) at input/input.c:485
#9 0x00007ffff77866db in start_thread (arg=0x7fffac136700) at pthread_create.c:463
#10 0x00007ffff74af88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: open file by file descriptor

Postby unidan » 17 Jul 2019 23:07

Hi, this is probably not the real issue, but it's difficult to tell like that.

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: open file by file descriptor

Postby mangup » 18 Jul 2019 10:25

hm. so, what can i do?


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 9 guests