Skip to content

Instantly share code, notes, and snippets.

View j0sh's full-sized avatar
🐠

Josh Allmann j0sh

🐠
View GitHub Profile
@j0sh
j0sh / Makefile
Created March 31, 2011 07:05
iOS static library cross-compile script.
# iOS builds for ARMv7 and simulator i386.
# Assumes any dependencies are in a local folder called libs and
# headers in a local folder called headers.
# Dependencies should already have been compiled for the target arch.
PROJ=untitled
ifeq ($(IOS), 1)
ARCH=armv7
DEVICE=OS
CC_FLAGS=-arch $(ARCH)
@j0sh
j0sh / ios-configure.sh
Created March 31, 2011 07:05
Sets up an autotoolized configure to cross-compile either an iOS device or simulator.
# Change the install prefix.
# Builds for i386 and ARMv7.
# Lipo them at your leisure.
PREFIX=/Users/josh/compiled
ERRSTR="Usage: ./ios-configure.sh <simulator | device>"
if [[ $# != 1 ]]; then
echo $ERRSTR
exit
fi
@j0sh
j0sh / 0001-Try-to-load-statically-linked-applications-first-the.patch
Created August 6, 2011 06:57
[PATCH] Try to load statically linked applications first, then dynamic ones.
From b3522c2d16b9424b2978b1c8a2fd1fddb6212d07 Mon Sep 17 00:00:00 2001
From: Josh Allmann <joshua.allmann@gmail.com>
Date: Fri, 5 Aug 2011 20:46:54 -1000
Subject: [PATCH] Try to load statically linked applications first, then dynamic ones.
This has two benefits:
1. Avoids specifying the link type in lua configuration
2. Enables statically linking core dependencies and applications
diff --git a/sources/common/src/utils/misc/crypto.cpp b/sources/common/src/utils/misc/crypto.cpp
index 9d4e20a..ed41c71 100644
--- a/sources/common/src/utils/misc/crypto.cpp
+++ b/sources/common/src/utils/misc/crypto.cpp
@@ -119,6 +119,7 @@ bool DHWrapper::CreateSharedKey(uint8_t *pPeerPublicKey, int32_t length) {
return false;
}
_pSharedKey = new uint8_t[_sharedKeyLength];
+ memset(_pSharedKey, 0, _sharedKeyLength);
diff --git a/sources/common/src/utils/misc/variant.cpp b/sources/common/src/utils/misc/variant.cpp
index 62361ea..7579749 100644
--- a/sources/common/src/utils/misc/variant.cpp
+++ b/sources/common/src/utils/misc/variant.cpp
@@ -697,22 +697,22 @@ Variant& Variant::operator[](const double &key) {
}
Variant& Variant::operator[](const uint32_t &key) {
- stringstream ss;
- ss << VAR_INDEX_VALUE << key;
@j0sh
j0sh / gist:1274714
Created October 10, 2011 06:00
fix audio concatenation in the case of >2 chunks
diff --git a/sources/thelib/src/protocols/rtp/streaming/outnetrtpudph264stream.cpp b/sources/thelib/src/protocols/rtp/streaming/outnetrtpudph264stream.cpp
index 32e36ba..cc7591b 100644
--- a/sources/thelib/src/protocols/rtp/streaming/outnetrtpudph264stream.cpp
+++ b/sources/thelib/src/protocols/rtp/streaming/outnetrtpudph264stream.cpp
@@ -331,7 +331,7 @@ bool OutNetRTPUDPH264Stream::FeedDataAudioMPEG4Generic_one_by_one(uint8_t *pData
} else {
//4. This is not the first chunk. Test to see if this is
//the last chunk or not
- if (totalLength < processedLength + dataLength) {
+ if (processedLength + dataLength < totalLength) {
@j0sh
j0sh / gist:1290577
Created October 16, 2011 06:30
RTP: Fix check for UDP transport.
diff --git a/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp b/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp
index 4848c54..c632a0d 100644
--- a/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp
+++ b/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp
@@ -552,7 +552,7 @@ bool BaseRTSPAppProtocolHandler::HandleRTSPRequestSetupInbound(RTSPProtocol *pFr
//2. Check and see if it has RTP/AVP/TCP,RTP/AVP/UDP or RTP/AVP
if ((!transport.HasKey("rtp/avp/tcp"))
- && (!transport.HasKey("rtp/avp/usp"))
+ && (!transport.HasKey("rtp/avp/udp"))
@j0sh
j0sh / gist:1297236
Created October 19, 2011 01:12
Make FFmpeg RTMP work with RTMPD.
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 093d21a..cee696b 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -74,6 +74,7 @@ typedef struct RTMPContext {
int skip_bytes; ///< number of bytes to skip from the input FLV stream in the next write call
uint8_t flv_header[11]; ///< partial incoming flv packet header
int flv_header_bytes; ///< number of initialized bytes in flv_header
+ int nb_invokes; //< keeps track of invoke messages
} RTMPContext;
@j0sh
j0sh / cmake
Created November 2, 2011 19:03
rtmpd oneiric
diff --git a/builders/cmake/cmake_find_modules/Find_openssl.cmake b/builders/cmake/cmake_find_modules/Find_openssl.cmake
index ff366a0..eac1244 100644
--- a/builders/cmake/cmake_find_modules/Find_openssl.cmake
+++ b/builders/cmake/cmake_find_modules/Find_openssl.cmake
@@ -26,7 +26,7 @@ FIND_LIBRARY(OPENSSL_LIBRARY_PATH
/sw/lib
/usr/local/ssl/lib
/lib
- NO_DEFAULT_PATH)
+ )
From 94eee34601fdf06298b3306b1102662645a53e6c Mon Sep 17 00:00:00 2001
From: Josh Allmann <joshua.allmann@gmail.com>
Date: Tue, 8 Nov 2011 09:26:08 -0800
Subject: [PATCH 1/3] -- Check for valid input to ProcessInvokeDeleteStream.
---
.../protocols/rtmp/basertmpappprotocolhandler.cpp | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp b/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp