Skip to content

Commit

Permalink
endian was backward durr!
Browse files Browse the repository at this point in the history
  • Loading branch information
zpmorgan committed Jan 28, 2012
1 parent acfaa44 commit 5a28e63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/PDL/GStreamer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ sub _read_audio_caps{
my $caps_obj = shift;
my $caps = $caps_obj->to_string;
my ($endian) = $caps =~ /endianness=\(int\)(\d)/;
my $littleendian = $endian==4;
my $littleendian = $endian==1;
my ($rate) = $caps =~ /rate=\(int\)(\d+)\b/;
my ($signed) = $caps =~ /signed=\(boolean\)(\w+)\b/;
my $signedness = $signed eq 'true';
Expand All @@ -222,8 +222,8 @@ sub _read_audio_caps{
my ($channels) = $caps =~ /channels=\(int\)(\d)/;

my $ptemplate; #TEMPLATE for unpack. bleh.
$ptemplate = 's' if (($width==16) and !$littleendian);
$ptemplate = 'n' if (($width==16) and $littleendian);
$ptemplate = 'n' if (($width==16) and !$littleendian);
$ptemplate = 's' if (($width==16) and $littleendian);
die "$caps unpackable?" unless $ptemplate;

my $format = {
Expand Down

0 comments on commit 5a28e63

Please sign in to comment.