aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libdc1394.rb
blob: 2dd73cdbc793bb3299f9c55bbe4752fd8b6c8ec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require 'formula'

class Libdc1394 < Formula
  homepage 'http://damien.douxchamps.net/ieee1394/libdc1394/'
  url 'http://downloads.sourceforge.net/project/libdc1394/libdc1394-2/2.2.1/libdc1394-2.2.1.tar.gz'
  sha1 'b92c9670b68c4e5011148f16c87532bef2e5b808'

  depends_on :libtool
  depends_on :automake
  depends_on :autoconf

  def patches
    p = []
    # fix issue due to bug in OSX Firewire stack
    # libdc1394 author comments here:
    # http://permalink.gmane.org/gmane.comp.multimedia.libdc1394.devel/517
    p << DATA

    # Backport of upstream fixes for building on OS X
    p << "https://gist.github.com/jacknagel/7395159/raw/3ba722636fb898d210170f5d8a494977c89626b7/libdc1394.patch"
  end

  def install
    system "autoreconf", "-fvi"
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--disable-examples",
                          "--disable-sdltest"
    system "make install"
  end
end


__END__
diff --git a/dc1394/macosx/capture.c b/dc1394/macosx/capture.c
index c7c71f2..8959535 100644
--- a/dc1394/macosx/capture.c
+++ b/dc1394/macosx/capture.c
@@ -150,7 +150,7 @@ callback (buffer_info * buffer, NuDCLRef dcl)
 
     for (i = 0; i < buffer->num_dcls; i++) {
         int packet_size = capture->frames[buffer->i].packet_size;
-        if ((buffer->pkts[i].status & 0x1F) != 0x11) {
+        if (buffer->pkts[i].status && (buffer->pkts[i].status & 0x1F) != 0x11) {
             dc1394_log_warning ("packet %d had error status %x",
                     i, buffer->pkts[i].status);
             corrupt = 1;