4

I am using VLCJ libraries for developing an simple media player application on Mac and PC. On PC, all media files run smoothly. On a Mac when I run the application (after configurating the Mac .dylib files) I have managed to open the application and when I hit the progress bar the frames display properly, but when I want to actually play the file, I get the following error:

    /Users/ronenshani/Desktop/Cinenote/CineNotes/resources/icons/control_start_blue.png/Users/ronenshani/Desktop/Cinenote/CineNotes/resources/icons/control_rewind_blue.png/Users/ronenshani/Desktop/Cinenote/CineNotes/resources/icons/control_fastforward_blue.png/Users/ronenshani/Desktop/Cinenote/CineNotes/resources/icons/control_end_blue.pngSep 12 13:48:59 Ronens-MacBook-Pro.local java[59043] <Error>: CGContextGetCTM: invalid context 0x0
Sep 12 13:48:59 Ronens-MacBook-Pro.local java[59043] <Error>: CGContextSetBaseCTM: invalid context 0x0
Sep 12 13:48:59 Ronens-MacBook-Pro.local java[59043] <Error>: CGContextGetCTM: invalid context 0x0
Sep 12 13:48:59 Ronens-MacBook-Pro.local java[59043] <Error>: CGContextSetBaseCTM: invalid context 0x0
mediaChanged
opening
playing 
paused
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file
[0x7faeb4413f50] main vout display error: option macosx-video-autoresize does not exist
2012-09-12 13:49:18.133 java[59043:407] -[CocoaAppWindow isFullscreen]: unrecognized selector sent to instance 0x7faeaa4aba90
2012-09-12 13:49:18.134 java[59043:407] -[CocoaAppWindow isFullscreen]: unrecognized selector sent to instance 0x7faeaa4aba90
2012-09-12 13:49:18.166 java[59043:407] (
 0   CoreFoundation                      0x00007fff8dcf6f56 __exceptionPreprocess + 198
 1   libobjc.A.dylib                     0x00007fff8db84d5e objc_exception_throw + 43
 2   CoreFoundation                      0x00007fff8dd831be -[NSObject doesNotRecognizeSelector:] + 190
 3   CoreFoundation                      0x00007fff8dce3e23 ___forwarding___ + 371
 4   CoreFoundation                      0x00007fff8dce3c38 _CF_forwarding_prep_0 + 232
 5   libvout_macosx_plugin.dylib         0x0000000123affc21 -[VLCOpenGLVideoView setWindowFrameWithValue:] + 49
 6   CoreFoundation                      0x00007fff8dce670d -[NSObject performSelector:withObject:] + 61
 7   Foundation                          0x00007fff8eba6d70 __NSThreadPerformPerform + 214
 8   CoreFoundation                      0x00007fff8dc654f1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
 9   CoreFoundation                      0x00007fff8dc64d5d __CFRunLoopDoSources0 + 253
 10  CoreFoundation                      0x00007fff8dc8bb49 __CFRunLoopRun + 905
 11  CoreFoundation                      0x00007fff8dc8b486 CFRunLoopRunSpecific + 230
 12  HIToolbox                           0x00007fff868174d3 RunCurrentEventLoopInMode + 277
 13  HIToolbox                           0x00007fff8681e781 ReceiveNextEventCommon + 355
 14  HIToolbox                           0x00007fff8681e60e BlockUntilNextEventMatchingListInMode + 62
 15  AppKit                              0x00007fff83befe31 _DPSNextEvent + 659
 16  AppKit                              0x00007fff83bef735 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135
 17  libawt.jnilib                       0x0000000118bdcfe3 -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
 18  AppKit                              0x00007fff83bec071 -[NSApplication run] + 470
 19  libawt.jnilib                       0x0000000118bdb694 +[AWTStarter startAWT:] + 1495
 20  libawt.jnilib                       0x0000000118bdb00e -[CPerformer perform] + 93
 21  CoreFoundation                      0x00007fff8dce670d -[NSObject performSelector:withObject:] + 61
 22  Foundation                          0x00007fff8eba6d70 __NSThreadPerformPerform + 214
 23  CoreFoundation                      0x00007fff8dc654f1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
 24  CoreFoundation                      0x00007fff8dc64d5d __CFRunLoopDoSources0 + 253
 25  CoreFoundation                      0x00007fff8dc8bb49 __CFRunLoopRun + 905
 26  CoreFoundation                      0x00007fff8dc8b486 CFRunLoopRunSpecific + 230
 27  java                                0x000000010fa3a843 java + 18499
 28  java                                0x000000010fa3a29a java + 17050
 29  java                                0x000000010fa37a98 java + 6808
)
playingAssertion failed: (p->pause_date != VLC_TS_INVALID), function aout_PacketPause, file ../../extras/package/macosx/../../../src/audio_output/output.c, line 431.

I believe this is the core of the error, although I am not sure:

[0x7faeb4413f50] main vout display error: option macosx-video-autoresize does not exist
2012-09-12 13:49:18.133 java[59043:407] -[CocoaAppWindow isFullscreen]: unrecognized selector sent to instance 0x7faeaa4aba90
2012-09-12 13:49:18.134 java[59043:407] -[CocoaAppWindow isFullscreen]: unrecognized selector sent to instance 0x7faeaa4aba90

The application is using VLCJ wrapper for accessing the libvlc libraries.

If anyone has some insights on this matter, please let me know. I've been stuck on this error for a few days now and still haven't managed to figure it out.

Thanks, tamash

EDIT

After some digging in the code, I found that the following code from VLCJ was causing the error:

static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_name )
{
    module_config_t *p_config;

    **p_config = config_FindConfig( p_this, psz_name );**

    /* sanity checks */
    if( !p_config )
    {
        msg_Err( p_this, "option %s does not exist", psz_name );
        return NULL;
    }

    if ( p_config->psz_longtext )
        return p_config->psz_longtext;
    else if( p_config->psz_text )
        return p_config->psz_text;
    else
        msg_Warn( p_this, "option %s does not include any help", psz_name );

    return NULL;
}

and this function fails to load some config files (and this makes sense since there are some errors that were pointed out in the error message above: "Fontconfig error: Cannot load default config file"). Where can I find these config files on a Mac and where should I load them?

Tamas Ionut
  • 4,240
  • 5
  • 36
  • 59
  • VLCJ library is always JNA wrapper (in Java language) to VLC dynamic libraries (libVLC). I believe the code after your last edit are not from VLCJ; it is from libVLC itself (in C/C++ language). Different VLCJ version requires different libVLC version. Can you tell which version of VLCJ and libVLC you are using right now under Windows and OSX? Please state the JNA version as well. http://code.google.com/p/vlcj/wiki/WhichVersion – ee. Sep 26 '12 at 04:05

1 Answers1

0

After all the issue to this bug was that the libvlc library was looking for "vlcrc" file under "/Library/Preferences/org.videolan.vlc" folder on a Mac. However, also after opening the video file, I started and paused the embedded media player component provided by the VLCJ library:

mediaPlayer.start();
mediaPlayer.pause();

since I wanted the movie to be paused at startup, but the first frame to be displayed. After commenting out the second line, it worked.

Tamas Ionut
  • 4,240
  • 5
  • 36
  • 59