Bug 191743

Summary: multimedia/mplayer libavcodec/frame_thread_encoder.c:50:5: error: unknown type name 'pthread_mutex_t' amd64
Product: Ports & Packages Reporter: mikhail.rokhin
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Many People    
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   

Description mikhail.rokhin 2014-07-08 18:01:48 UTC
FreeBSD win95 11.0-CURRENT FreeBSD 11.0-CURRENT #9 r267913: Thu Jun 26 20:56:49 MSK 2014     root@win95:/usr/obj/usr/src/sys/GENERIC  amd64



make -C /usr/ports/multimedia/mplayer
===>  Building for mplayer-1.1.r20140418_3
gmake[2]: Entering directory `/usr/ports/multimedia/mplayer/work/mplayer-export-2014-04-18'
gmake -C ffmpeg libavcodec/libavcodec.a
gmake[3]: Entering directory `/usr/ports/multimedia/mplayer/work/mplayer-export-2014-04-18/ffmpeg'
CC      libavcodec/frame_thread_encoder.o
CC      libavcodec/g2meet.o
CC      libavcodec/g722.o
clangclang: warning: argument unused during compilation: '-mcpu=generic'
: warning: argument unused during compilation: '-mcpu=generic'
clang: warning: argument unused during compilation: '-mcpu=generic'
libavcodec/frame_thread_encoder.c:50:5: error: unknown type name 'pthread_mutex_t'
    pthread_mutex_t buffer_mutex;
    ^
libavcodec/frame_thread_encoder.c:53:5: error: unknown type name 'pthread_mutex_t'
    pthread_mutex_t task_fifo_mutex;
    ^
libavcodec/frame_thread_encoder.c:54:5: error: unknown type name 'pthread_cond_t'
    pthread_cond_t task_fifo_cond;
    ^
libavcodec/frame_thread_encoder.c:57:5: error: unknown type name 'pthread_mutex_t'
    pthread_mutex_t finished_task_mutex;
    ^
libavcodec/frame_thread_encoder.c:58:5: error: unknown type name 'pthread_cond_t'
    pthread_cond_t finished_task_cond;
    ^
libavcodec/frame_thread_encoder.c:63:5: error: unknown type name 'pthread_t'
    pthread_t worker[MAX_THREADS];
    ^
libavcodec/frame_thread_encoder.c:81:9: warning: implicit declaration of function
      'pthread_mutex_lock' is invalid in C99 [-Wimplicit-function-declaration]
        pthread_mutex_lock(&c->task_fifo_mutex);
        ^
libavcodec/frame_thread_encoder.c:84:17: warning: implicit declaration of function
      'pthread_mutex_unlock' is invalid in C99 [-Wimplicit-function-declaration]
                pthread_mutex_unlock(&c->task_fifo_mutex);
                ^
libavcodec/frame_thread_encoder.c:87:13: warning: implicit declaration of function
      'pthread_cond_wait' is invalid in C99 [-Wimplicit-function-declaration]
            pthread_cond_wait(&c->task_fifo_cond, &c->task_fifo_mutex);
            ^
libavcodec/frame_thread_encoder.c:107:9: warning: implicit declaration of function
      'pthread_cond_signal' is invalid in C99 [-Wimplicit-function-declaration]
        pthread_cond_signal(&c->finished_task_cond);
        ^
libavcodec/frame_thread_encoder.c:175:5: warning: implicit declaration of function
      'pthread_mutex_init' is invalid in C99 [-Wimplicit-function-declaration]
    pthread_mutex_init(&c->task_fifo_mutex, NULL);
    ^
libavcodec/frame_thread_encoder.c:178:5: warning: implicit declaration of function
      'pthread_cond_init' is invalid in C99 [-Wimplicit-function-declaration]
    pthread_cond_init(&c->task_fifo_cond, NULL);
    ^
libavcodec/frame_thread_encoder.c:204:12: warning: implicit declaration of function
      'pthread_create' is invalid in C99 [-Wimplicit-function-declaration]
        if(pthread_create(&c->worker[i], NULL, worker, thread_avctx)) {
           ^
libavcodec/frame_thread_encoder.c:225:5: warning: implicit declaration of function
      'pthread_cond_broadcast' is invalid in C99 [-Wimplicit-function-declaration]
    pthread_cond_broadcast(&c->task_fifo_cond);
    ^
libavcodec/frame_thread_encoder.c:229:10: warning: implicit declaration of function
      'pthread_join' is invalid in C99 [-Wimplicit-function-declaration]
         pthread_join(c->worker[i], NULL);
         ^
libavcodec/frame_thread_encoder.c:232:5: warning: implicit declaration of function
      'pthread_mutex_destroy' is invalid in C99 [-Wimplicit-function-declaration]
    pthread_mutex_destroy(&c->task_fifo_mutex);
    ^
libavcodec/frame_thread_encoder.c:235:5: warning: implicit declaration of function
      'pthread_cond_destroy' is invalid in C99 [-Wimplicit-function-declaration]
    pthread_cond_destroy(&c->task_fifo_cond);
    ^
In file included from libavcodec/g2meet.c:32:
libavcodec/bytestream.h:181:15: warning: comparison of integers of different signs: 'int' and
      'unsigned int' [-Wsign-compare]
    if (size2 != size)
        ~~~~~ ^  ~~~~
libavcodec/frame_thread_encoder.c:275:121: warning: comparison of integers of different signs:
      'unsigned int' and 'int' [-Wsign-compare]
  ...&& (c->task_index - c->finished_task_index) % BUFFER_SIZE <= avctx->thread_count)
libavcodec/bytestream.h:288:15: warning: comparison of integers of different signs: 'int' and
      'unsigned int' [-Wsign-compare]
    if (size2 != size)
        ~~~~~ ^  ~~~~
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~CC libavcodec/g722dec.o

libavcodec/bytestream.h:312:15: warning: comparison of integers of different signs: 'int' and
      'unsigned int' [-Wsign-compare]
    if (size2 != size)
        ~~~~~ ^  ~~~~
12 warnings and 6 errors generated.
libavcodec/bytestream.h:351:15: warning: comparison of integers of different gmake[3]: *** [libavcodec/frame_thread_encoder.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
signs: 'int' and
      'unsigned int' [-Wsign-compare]
    if (size2 != size)
        ~~~~~ ^  ~~~~
clang: warning: argument unused during compilation: '-mcpu=generic'
libavcodec/g2meet.c:228:56: warning: operator '>>' has lower precedence than '+'; '+' will be
      evaluated first [-Wshift-op-parentheses]
    out[0] = av_clip_uint8(Y + (             91881 * V + 32768 >> 16));
                                             ~~~~~~~~~~^~~~~~~ ~~
libavcodec/g2meet.c:228:56: note: place parentheses around the '+' expression to silence this
      warning
    out[0] = av_clip_uint8(Y + (             91881 * V + 32768 >> 16));
                                                       ^
                                             (                )                                
libavcodec/g2meet.c:229:56: warning: operator '>>' has lower precedence than '+'; '+' will be
      evaluated first [-Wshift-op-parentheses]
    out[1] = av_clip_uint8(Y + (-22554 * U - 46802 * V + 32768 >> 16));
                                ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ~~
libavcodec/g2meet.c:229:56: note: place parentheses around the '+' expression to silence this
      warning
    out[1] = av_clip_uint8(Y + (-22554 * U - 46802 * V + 32768 >> 16));
                                                       ^
                                (                             )                                
libavcodec/g2meet.c:230:56: warning: operator '>>' has lower precedence than '+'; '+' will be
      evaluated first [-Wshift-op-parentheses]
    out[2] = av_clip_uint8(Y + (116130 * U             + 32768 >> 16));
                                ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ~~
libavcodec/g2meet.c:230:56: note: place parentheses around the '+' expression to silence this
      warning
    out[2] = av_clip_uint8(Y + (116130 * U             + 32768 >> 16));
                                                       ^
                                (                             )
libavcodec/g2meet.c:519:39: warning: comparison of integers of different signs: 'int' and
      'uint32_t' (aka 'unsigned int') [-Wsign-compare]
        c->cursor_w * c->cursor_h / 4 > cur_size) {
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~
libavcodec/g722dec.c:47:121: warning: missing field 'unit' initializer
      [-Wmissing-field-initializers]
  ...G722 codeword", OFFSET(bits_per_codeword), AV_OPT_TYPE_INT, { .i64 = 8 }, 6, 8, AD },
                                                                                        ^
libavcodec/g722dec.c:48:12: warning: missing field 'help' initializer
      [-Wmissing-field-initializers]
    { NULL }
           ^
2 warnings generated.
8 warnings generated.
gmake[3]: Leaving directory `/usr/ports/multimedia/mplayer/work/mplayer-export-2014-04-18/ffmpeg'
gmake[2]: *** [ffmpeg/libavcodec/libavcodec.a] Error 2
gmake[2]: Leaving directory `/usr/ports/multimedia/mplayer/work/mplayer-export-2014-04-18'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/multimedia/mplayer
*** Error code 1
Comment 1 Thomas Zander freebsd_committer 2014-07-13 17:45:03 UTC
Is this the standard set of OPTIONS or a special set?
In any case, this should really not be a problem.
The pthread includes on CURRENT these days look fine.
I just tested the mplayer port on a freshly set-up machine:
FreeBSD current 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r268572: Sat Jul 12 22:42:09 UTC 2014     root@current:/usr/obj/usr/src/sys/GENERIC  amd64
and an up-to-date ports tree. Works like a charm here.
Could you check with an up-to-date system and default options?
Comment 2 mikhail.rokhin 2014-07-14 12:30:06 UTC
ports tree is up-to-date, options aren't default. As virtualbox is not fully supported on amd64 I can't paste here options. But I hope it must compile with all options proposed, am I right?

(In reply to Thomas Zander from comment #1)
> Is this the standard set of OPTIONS or a special set?
> In any case, this should really not be a problem.
> The pthread includes on CURRENT these days look fine.
> I just tested the mplayer port on a freshly set-up machine:
> FreeBSD current 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r268572: Sat Jul 12
> 22:42:09 UTC 2014     root@current:/usr/obj/usr/src/sys/GENERIC  amd64
> and an up-to-date ports tree. Works like a charm here.
> Could you check with an up-to-date system and default options?
Comment 3 Thomas Zander freebsd_committer 2014-07-14 15:58:39 UTC
(In reply to mikhail.rokhin from comment #2)
> ports tree is up-to-date, options aren't default. As virtualbox is not fully
> supported on amd64 I can't paste here options. But I hope it must compile
> with all options proposed, am I right?

In general, yes, you are right. Every combination is supposed to compile. But please consider this: mplayer today supports 46 OPTIONS that can be turned on and off. That yields 2**46 == 70368744177664 possible build scenarios. Building mplayer on my build machine takes about 6.5 minutes if it is otherwise idle, so building every combination would require more than 870 million years.
(And that is only for one of the supported hardware architectures!)

Without shame, I readily admit: Due to a lack of time, I have not tested all of them :-)

But, because I have set up a fresh CURRENT box yesterday and tested mplayer in my usual configurations which work fine, it would really help for you to try and see if a build with default OPTIONS works and to paste me those OPTIONS you are using. Without the ability to reproduce the problem, I can't fix it.

The other possibility is, of course, for you to resolve the bug and propose a patch to the port.
Comment 4 mikhail.rokhin 2014-07-14 18:25:10 UTC
root@win95:~ # make config -C /usr/ports/multimedia/mplayer

      ┌───────────────────────── mplayer-1.1.r20140418_3 ────────────────────────────┐
      │ ┌──────────────────────────────────────────────────────────────────────────┐ │  
      │ │ [x] AALIB         AAlib graphics library support                         │ │  
      │ │ [x] AMR_NB        AMR Narrow Band audio support (opencore)               │ │  
      │ │ [x] AMR_WB        AMR Wide Band audio support (opencore)                 │ │  
      │ │ [ ] BLURAY        BluRay support                                         │ │  
      │ │ [x] CACA          libcaca graphics library support                       │ │  
      │ │ [ ] DEBUG         Build with debugging support                           │ │  
      │ │ [x] DV            Quasar DV video codec support (libdv)                  │ │  
      │ │ [x] ENCA          Charset conversion via enca                            │ │  
      │ │ [ ] FRIBIDI       Bidirectional text support via GNU FriBidi             │ │  
      │ │ [x] GIF           GIF image format support                               │ │  
      │ │ [x] GSM           GSM codec support                                      │ │  
      │ │ [x] GUI           GUI (Graphical User Interface) support                 │ │  
      │ │ [x] IPV6          IPv6 protocol support                                  │ │  
      │ │ [ ] JACK          JACK audio server support                              │ │  
      │ │ [ ] LADSPA        LADSPA audio plugins support                           │ │  
      │ │ [ ] LIBMNG        MNG animated images support via libmng                 │ │  
      │ │ [ ] LIRC          Infrared remote control support                        │ │  
      │ │ [ ] LZO           External liblzo support                                │ │  
      │ │ [ ] NAS           Network Audio System support                           │ │  
      │ │ [ ] OCFLAGS       Use optimized compiler flags                           │ │  
      │ │ [ ] OPENAL        Audio support via OpenAL                               │ │  
      │ │ [x] OPENGL        2D/3D rendering support via OpenGL                     │ │  
      │ └─────┴(+)─────────────────────────────────────────────────────────44%─────┘ │  
      ├──────────────────────────────────────────────────────────────────────────────┤  
      │                       <  OK  >            <Cancel>                           │  
      └──────────────────────────────────────────────────────────────────────────────┘  
                                                                                        

      ┌───────────────────────── mplayer-1.1.r20140418_3 ────────────────────────────┐
      │ ┌─────^(-)─────────────────────────────────────────────────────────────────┐ │  
      │ │ [x] OPENJPEG      Enhanced JPEG graphics support                         │ │  
      │ │ [ ] OPUS          Opus audio codec support                               │ │  
      │ │ [ ] OTCHAIN       Use gcc 4.6+ toolchain on legacy systems               │ │  
      │ │ [x] PROFILE       Build with profiling support                           │ │  
      │ │ [x] PULSEAUDIO    PulseAudio sound server support                        │ │  
      │ │ [x] REAL          Enable realplayer plugin                               │ │  
      │ │ [x] RTC           Add support for kernel real time clock                 │ │  
      │ │ [x] RTCPU         Use runtime CPU detection on supported archs           │ │  
      │ │ [ ] RTMP          RTMP protocol support via librtmp                      │ │  
      │ │ [ ] SCHROEDINGER  Dirac video codec support via libschroedinger          │ │  
      │ │ [ ] SDL           Simple Direct Media Layer support                      │ │  
      │ │ [x] SKINS         Install skins for GUI                                  │ │  
      │ │ [ ] SMB           SMB network protocol support                           │ │  
      │ │ [ ] SVGALIB       SVGA graphics support                                  │ │  
      │ │ [x] V4L           Video 4 Linux support                                  │ │  
      │ │ [x] VDPAU         VDPAU (GPU video acceleration) support                 │ │  
      │ │ [x] VPX           VP8/VP9 video codec support                            │ │  
      │ │ [x] WIN32         Install win32 binary codecs                            │ │  
      │ │ [x] X11           X11 (graphics) support                                 │ │  
      │ │ [x] X11DGA        X11 DGA video driver support                           │ │  
      │ │ [x] X11VM         X11 VidMode support                                    │ │  
      │ │ [x] XINERAMA      X11 Xinerama extension support                         │ │  
      │ └─────┴(+)─────────────────────────────────────────────────────────89%─────┘ │  
      ├──────────────────────────────────────────────────────────────────────────────┤  
      │                       <  OK  >            <Cancel>                           │  
      └──────────────────────────────────────────────────────────────────────────────┘  


      ┌───────────────────────── mplayer-1.1.r20140418_3 ────────────────────────────┐
      │ ┌─────^(-)─────────────────────────────────────────────────────────────────┐ │  
      │ │ [x] REAL          Enable realplayer plugin                               │ │  
      │ │ [x] RTC           Add support for kernel real time clock                 │ │  
      │ │ [x] RTCPU         Use runtime CPU detection on supported archs           │ │  
      │ │ [ ] RTMP          RTMP protocol support via librtmp                      │ │  
      │ │ [ ] SCHROEDINGER  Dirac video codec support via libschroedinger          │ │  
      │ │ [ ] SDL           Simple Direct Media Layer support                      │ │  
      │ │ [x] SKINS         Install skins for GUI                                  │ │  
      │ │ [ ] SMB           SMB network protocol support                           │ │  
      │ │ [ ] SVGALIB       SVGA graphics support                                  │ │  
      │ │ [x] V4L           Video 4 Linux support                                  │ │  
      │ │ [x] VDPAU         VDPAU (GPU video acceleration) support                 │ │  
      │ │ [x] VPX           VP8/VP9 video codec support                            │ │  
      │ │ [x] WIN32         Install win32 binary codecs                            │ │  
      │ │ [x] X11           X11 (graphics) support                                 │ │  
      │ │ [x] X11DGA        X11 DGA video driver support                           │ │  
      │ │ [x] X11VM         X11 VidMode support                                    │ │  
      │ │ [x] XINERAMA      X11 Xinerama extension support                         │ │  
      │ │ [x] XVIDEO        X11 Video extension library support                    │ │  
      │ │ [x] XVMC          X11 XvMC video extension support                       │ │  
      │ │─────────────────────────────────── RGCD ─────────────────────────────────│ │  
      │ │ ( ) CDIO          CDIO support via libcdio                               │ │  
      │ │ (*) CDPARANOIA    CD ripping support (cdparanoia)                        │ │  
      │ └──────────────────────────────────────────────────────────────────100%────┘ │  
      ├──────────────────────────────────────────────────────────────────────────────┤  
      │                       <  OK  >            <Cancel>                           │  
      └──────────────────────────────────────────────────────────────────────────────┘  
                                                                                        

(In reply to Thomas Zander from comment #3)
> (In reply to mikhail.rokhin from comment #2)
> > ports tree is up-to-date, options aren't default. As virtualbox is not fully
> > supported on amd64 I can't paste here options. But I hope it must compile
> > with all options proposed, am I right?
> 
> In general, yes, you are right. Every combination is supposed to compile.
> But please consider this: mplayer today supports 46 OPTIONS that can be
> turned on and off. That yields 2**46 == 70368744177664 possible build
> scenarios. Building mplayer on my build machine takes about 6.5 minutes if
> it is otherwise idle, so building every combination would require more than
> 870 million years.
> (And that is only for one of the supported hardware architectures!)
> 
> Without shame, I readily admit: Due to a lack of time, I have not tested all
> of them :-)
> 
> But, because I have set up a fresh CURRENT box yesterday and tested mplayer
> in my usual configurations which work fine, it would really help for you to
> try and see if a build with default OPTIONS works and to paste me those
> OPTIONS you are using. Without the ability to reproduce the problem, I can't
> fix it.
> 
> The other possibility is, of course, for you to resolve the bug and propose
> a patch to the port.
Comment 5 Thomas Zander freebsd_committer 2014-07-14 19:00:19 UTC
Can you try and disable PROFILE?
Comment 6 Thomas Zander freebsd_committer 2014-08-29 09:58:58 UTC
Fixed in r366488.