ports/121707: fatal multimedia/vlc build error

Jonathan Lennox lennox at cs.columbia.edu
Wed Mar 19 16:10:03 UTC 2008


The following reply was made to PR ports/121707; it has been noted by GNATS.

From: Jonathan Lennox <lennox at cs.columbia.edu>
To: bug-followup at FreeBSD.org,hg at cally.queue.to
Cc:  
Subject: Re: ports/121707: fatal multimedia/vlc build error
Date: Wed, 19 Mar 2008 11:49:07 -0400

 The actual build error here is the following:
 
 mkv.cpp: In member function 'virtual bool dvd_chapter_codec_c::Enter()':
 mkv.cpp:5848: error: no matching function for call to 'min(size_t&, long long unsigned int)'
 mkv.cpp: In member function 'virtual bool dvd_chapter_codec_c::Leave()':
 mkv.cpp:5871: error: no matching function for call to 'min(size_t&, long long unsigned int)'
 
 I see this on FreeBSD 5.5 as well.
 
 This occurs because there's a call to min (which is a template function)
 taking arguments of type size_t and uint64_t, and min<size_t> and
 min<unsigned long long> are equally good resolutions of that template.
 
 The following patch file (added as,
 e.g. multimedia/vlc/files/patch-modules_demux_mkv.cpp) fixes the problem by
 making the choice of template instantiation explicit.
 
 --- modules/demux/mkv.cpp.orig	Sun Feb 24 14:01:53 2008
 +++ modules/demux/mkv.cpp	Wed Mar 19 11:45:02 2008
 @@ -5845,7 +5845,7 @@ bool dvd_chapter_codec_c::Enter()
              binary *p_data = (*index)->GetBuffer();
              size_t i_size = *p_data++;
              // avoid reading too much from the buffer
 -            i_size = min( i_size, ((*index)->GetSize() - 1) >> 3 );
 +            i_size = min<size_t>( i_size, ((*index)->GetSize() - 1) >> 3 );
              for ( ; i_size > 0; i_size--, p_data += 8 )
              {
                  msg_Dbg( &sys.demuxer, "Matroska DVD enter command" );
 @@ -5868,7 +5868,7 @@ bool dvd_chapter_codec_c::Leave()
              binary *p_data = (*index)->GetBuffer();
              size_t i_size = *p_data++;
              // avoid reading too much from the buffer
 -            i_size = min( i_size, ((*index)->GetSize() - 1) >> 3 );
 +            i_size = min<size_t>( i_size, ((*index)->GetSize() - 1) >> 3 );
              for ( ; i_size > 0; i_size--, p_data += 8 )
              {
                  msg_Dbg( &sys.demuxer, "Matroska DVD leave command" );
 
 -- 
 Jonathan Lennox
 lennox at cs.columbia.edu


More information about the freebsd-multimedia mailing list