1

I have a WPF application with multiple VLC player, (using LibVLCSharp.WPF). For each player, I create a new instance of LibVLC and I subscribe to the Log event.

    public Player()
    {
        InitializeComponent();

        _libVLC = new LibVLC();
        _mediaPlayer = new MediaPlayer(_libVLC);

        // we need the VideoView to be fully loaded before setting a MediaPlayer on it.
        VideoView.Loaded += (sender, e) => VideoView.MediaPlayer = _mediaPlayer;
        _libVLC.Log += MediaPlayerOnLog;
    }

The problem is that each log is handled by all the subscribers, so I don't know which player caused which log.

Example: If I try to play rtsp://test on a player, I receive this log for all the player

[10:52:43.792 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 1 live555: Failed to connect with rtsp://test:554/

[10:52:43.793 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 2 live555: Failed to connect with rtsp://test:554/

[10:52:43.793 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 3 live555: Failed to connect with rtsp://test:554/

[10:52:43.793 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 4 live555: Failed to connect with rtsp://test:554/

Is it possible to have the logs per player?

Community
  • 1
  • 1
sroll
  • 752
  • 7
  • 20

1 Answers1

0

In your MediaPlayerOnLog method, can you add a specific text to your logs?

Something like $"Player {playerId} : {message}"

cube45
  • 3,429
  • 2
  • 24
  • 35
  • Yes, this is already what I do. The problem I have is that the same Log event is raised on all the LibVlc insances. – sroll Sep 02 '19 at 11:10
  • sorry, I misread your question. This seems either like a bug in LibVLCSharp or a bug in libvlc. Either way, I'd recommend that you submit a bug on https://code.videolan.org/videolan/LibVLCSharp – cube45 Sep 02 '19 at 15:07
  • Fixed in 3.2.2. Thanks for the report – mfkl Sep 23 '19 at 13:35