[FFmpeg-cvslog] rtmpdh: Make sure ret is initialized in the nettle version of bn_hex2bn

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu May 28 
09:47:44 2015 +0300| [78efc69e7c990226f4b913721ef1b308ca5bfa04] | committer: 
Martin Storsjö

rtmpdh: Make sure ret is initialized in the nettle version of bn_hex2bn

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=78efc69e7c990226f4b913721ef1b308ca5bfa04
---

 libavformat/rtmpdh.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index 38c2f3d..ddb2a46 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -77,6 +77,8 @@
 bn_new(bn); \
 if (bn) \
 ret = (mpz_set_str(bn, buf, 16) == 0);  \
+else\
+ret = 1;\
 } while (0)
 #define bn_modexp(bn, y, q, p)  mpz_powm(bn, y, q, p)
 #define bn_random(bn, num_bytes)\

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '78efc69e7c990226f4b913721ef1b308ca5bfa04'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
11:21:26 2015 +0200| [392832fc3ab1b506b750ec8a1bcc83e1396bc7c9] | committer: 
Michael Niedermayer

Merge commit '78efc69e7c990226f4b913721ef1b308ca5bfa04'

* commit '78efc69e7c990226f4b913721ef1b308ca5bfa04':
  rtmpdh: Make sure ret is initialized in the nettle version of bn_hex2bn

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=392832fc3ab1b506b750ec8a1bcc83e1396bc7c9
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rtmpdh: Pass the actual buffer size of the output secret key

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu May 28 
10:11:27 2015 +0300| [0508faaa11bf7507ffdd655aee57c9dc5a8203f4] | committer: 
Martin Storsjö

rtmpdh: Pass the actual buffer size of the output secret key

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0508faaa11bf7507ffdd655aee57c9dc5a8203f4
---

 libavformat/rtmpcrypt.c |2 +-
 libavformat/rtmpdh.c|5 +++--
 libavformat/rtmpdh.h|6 --
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/libavformat/rtmpcrypt.c b/libavformat/rtmpcrypt.c
index dfdd029..887427d 100644
--- a/libavformat/rtmpcrypt.c
+++ b/libavformat/rtmpcrypt.c
@@ -163,7 +163,7 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const 
uint8_t *serverdata,
 
 /* compute the shared secret secret in order to compute RC4 keys */
 if ((ret = ff_dh_compute_shared_secret_key(rt->dh, serverdata + server_pos,
-   128, secret_key)) < 0)
+   128, secret_key, 
sizeof(secret_key))) < 0)
 return ret;
 
 /* set output key */
diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index 80cced9..f328e68 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -313,7 +313,8 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int 
pub_key_len)
 }
 
 int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
-int pub_key_len, uint8_t *secret_key)
+int pub_key_len, uint8_t *secret_key,
+int secret_key_len)
 {
 FFBigNum q1 = NULL, pub_key_bn = NULL;
 int ret;
@@ -333,7 +334,7 @@ int ff_dh_compute_shared_secret_key(FF_DH *dh, const 
uint8_t *pub_key,
 /* when the public key is valid we have to compute the shared secret key */
 if ((ret = dh_is_valid_public_key(pub_key_bn, dh->p, q1)) < 0) {
 goto fail;
-} else if ((ret = dh_compute_key(dh, pub_key_bn, pub_key_len,
+} else if ((ret = dh_compute_key(dh, pub_key_bn, secret_key_len,
  secret_key)) < 0) {
 ret = AVERROR(EINVAL);
 goto fail;
diff --git a/libavformat/rtmpdh.h b/libavformat/rtmpdh.h
index 5de8bde..425113f 100644
--- a/libavformat/rtmpdh.h
+++ b/libavformat/rtmpdh.h
@@ -92,11 +92,13 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int 
pub_key_len);
  *
  * @param dha Diffie-Hellmann context, containing the private key
  * @param pub_key   the buffer containing the public key
- * @param pub_key_len   the length of the buffer
+ * @param pub_key_len   the length of the public key buffer
  * @param secret_keythe buffer where the secret key is written
+ * @param secret_key_len the length of the secret key buffer
  * @return length of the shared secret key on success, negative value otherwise
  */
 int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
-int pub_key_len, uint8_t *secret_key);
+int pub_key_len, uint8_t *secret_key,
+int secret_key_len);
 
 #endif /* AVFORMAT_RTMPDH_H */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rtmpdh: Fix a local variable name in the nettle/gcrypt codepath

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu May 28 
10:03:39 2015 +0300| [127d813bcb5705202b7100cf1eccd1e26d72ba14] | committer: 
Martin Storsjö

rtmpdh: Fix a local variable name in the nettle/gcrypt codepath

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=127d813bcb5705202b7100cf1eccd1e26d72ba14
---

 libavformat/rtmpdh.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index ddb2a46..bd9813d 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -134,7 +134,7 @@ static FFBigNum dh_generate_key(FF_DH *dh)
 }
 
 static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
-  uint32_t pub_key_len, uint8_t *secret_key)
+  uint32_t secret_key_len, uint8_t *secret_key)
 {
 FFBigNum k;
 int num_bytes;
@@ -148,11 +148,11 @@ static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
 return -1;
 
 bn_modexp(k, pub_key_bn, dh->priv_key, dh->p);
-bn_bn2bin(k, secret_key, pub_key_len);
+bn_bn2bin(k, secret_key, secret_key_len);
 bn_free(k);
 
 /* return the length of the shared secret key like DH_compute_key */
-return pub_key_len;
+return secret_key_len;
 }
 
 void ff_dh_free(FF_DH *dh)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '0508faaa11bf7507ffdd655aee57c9dc5a8203f4'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
11:31:55 2015 +0200| [fbeb3fa999e8712af35f1d898ca0b0cbab707556] | committer: 
Michael Niedermayer

Merge commit '0508faaa11bf7507ffdd655aee57c9dc5a8203f4'

* commit '0508faaa11bf7507ffdd655aee57c9dc5a8203f4':
  rtmpdh: Pass the actual buffer size of the output secret key

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fbeb3fa999e8712af35f1d898ca0b0cbab707556
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '9f1b3050d9e31e9283d818f3640f3460ac8cfb5b'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
11:31:38 2015 +0200| [beecbe13a2ea49280554a7178bebc525e538b4e7] | committer: 
Michael Niedermayer

Merge commit '9f1b3050d9e31e9283d818f3640f3460ac8cfb5b'

* commit '9f1b3050d9e31e9283d818f3640f3460ac8cfb5b':
  rtmpdh: Check the output buffer size in the openssl version of dh_compute_key

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=beecbe13a2ea49280554a7178bebc525e538b4e7
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '127d813bcb5705202b7100cf1eccd1e26d72ba14'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
11:31:22 2015 +0200| [4c0b30b07a81727561cafc171a1d0182a5975a48] | committer: 
Michael Niedermayer

Merge commit '127d813bcb5705202b7100cf1eccd1e26d72ba14'

* commit '127d813bcb5705202b7100cf1eccd1e26d72ba14':
  rtmpdh: Fix a local variable name in the nettle/gcrypt codepath

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c0b30b07a81727561cafc171a1d0182a5975a48
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rtmpdh: Check the output buffer size in the openssl version of dh_compute_key

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu May 28 
10:08:27 2015 +0300| [9f1b3050d9e31e9283d818f3640f3460ac8cfb5b] | committer: 
Martin Storsjö

rtmpdh: Check the output buffer size in the openssl version of dh_compute_key

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f1b3050d9e31e9283d818f3640f3460ac8cfb5b
---

 libavformat/rtmpdh.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index bd9813d..80cced9 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -189,7 +189,14 @@ void ff_dh_free(FF_DH *dh)
 
 #define dh_new()DH_new()
 #define dh_generate_key(dh) DH_generate_key(dh)
-#define dh_compute_key(dh, pub, len, secret)DH_compute_key(secret, pub, dh)
+
+static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
+  uint32_t secret_key_len, uint8_t *secret_key)
+{
+if (secret_key_len < DH_size(dh))
+return AVERROR(EINVAL);
+return DH_compute_key(secret_key, pub_key_bn, dh);
+}
 
 void ff_dh_free(FF_DH *dh)
 {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rtmpdh: Remove an unnecessary check in the gcrypt/nettle dh_compute_key

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu May 28 
11:39:45 2015 +0300| [8016a1bd3b60e917e1b12748dd80c06c3462c286] | committer: 
Martin Storsjö

rtmpdh: Remove an unnecessary check in the gcrypt/nettle dh_compute_key

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8016a1bd3b60e917e1b12748dd80c06c3462c286
---

 libavformat/rtmpdh.c |5 -
 1 file changed, 5 deletions(-)

diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index c29b563..b73d987 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -137,11 +137,6 @@ static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
   uint32_t secret_key_len, uint8_t *secret_key)
 {
 FFBigNum k;
-int num_bytes;
-
-num_bytes = bn_num_bytes(dh->p);
-if (num_bytes <= 0 || num_bytes > MAX_BYTES)
-return -1;
 
 bn_new(k);
 if (!k)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'e9e86d9ef637f5a600c76b352ffe5a82b71b25d1'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
11:42:38 2015 +0200| [4b8b3efb1e40ba028c31a0e8747867f9240cc755] | committer: 
Michael Niedermayer

Merge commit 'e9e86d9ef637f5a600c76b352ffe5a82b71b25d1'

* commit 'e9e86d9ef637f5a600c76b352ffe5a82b71b25d1':
  rtmpdh: Create sufficiently long private keys for gcrypt/nettle

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b8b3efb1e40ba028c31a0e8747867f9240cc755
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rtmpdh: Create sufficiently long private keys for gcrypt/nettle

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu May 28 
11:42:44 2015 +0300| [e9e86d9ef637f5a600c76b352ffe5a82b71b25d1] | committer: 
Martin Storsjö

rtmpdh: Create sufficiently long private keys for gcrypt/nettle

There was a misunderstanding betewen bits and bytes for the parameter
value for generating random big numbers.

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e9e86d9ef637f5a600c76b352ffe5a82b71b25d1
---

 libavformat/rtmpdh.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index b73d987..5cc66c9 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -81,12 +81,12 @@
 ret = 1;\
 } while (0)
 #define bn_modexp(bn, y, q, p)  mpz_powm(bn, y, q, p)
-#define bn_random(bn, num_bytes)\
+#define bn_random(bn, num_bits) \
 do {\
 gmp_randstate_t rs; \
 gmp_randinit_mt(rs);\
 gmp_randseed_ui(rs, av_get_random_seed());  \
-mpz_urandomb(bn, rs, num_bytes);\
+mpz_urandomb(bn, rs, num_bits); \
 gmp_randclear(rs);  \
 } while (0)
 #elif CONFIG_GCRYPT
@@ -102,7 +102,7 @@
 #define bn_bin2bn(bn, buf, len) gcry_mpi_scan(&bn, GCRYMPI_FMT_USG, buf, 
len, NULL)
 #define bn_hex2bn(bn, buf, ret) ret = (gcry_mpi_scan(&bn, GCRYMPI_FMT_HEX, 
buf, 0, 0) == 0)
 #define bn_modexp(bn, y, q, p)  gcry_mpi_powm(bn, y, q, p)
-#define bn_random(bn, num_bytes)gcry_mpi_randomize(bn, num_bytes, 
GCRY_WEAK_RANDOM)
+#define bn_random(bn, num_bits) gcry_mpi_randomize(bn, num_bits, 
GCRY_WEAK_RANDOM)
 #endif
 
 #define MAX_BYTES 18000
@@ -120,7 +120,7 @@ static FFBigNum dh_generate_key(FF_DH *dh)
 bn_new(dh->priv_key);
 if (!dh->priv_key)
 return NULL;
-bn_random(dh->priv_key, num_bytes);
+bn_random(dh->priv_key, 8 * num_bytes);
 
 bn_new(dh->pub_key);
 if (!dh->pub_key) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '063f7467e4d14ab7fe01b2845dab60cc75df8b53'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
11:38:26 2015 +0200| [48e02e258c42ae2ee0d351f2f0bd620b087ababe] | committer: 
Michael Niedermayer

Merge commit '063f7467e4d14ab7fe01b2845dab60cc75df8b53'

* commit '063f7467e4d14ab7fe01b2845dab60cc75df8b53':
  rtmpdh: Add fate test for the DH handshake routine

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48e02e258c42ae2ee0d351f2f0bd620b087ababe
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '8016a1bd3b60e917e1b12748dd80c06c3462c286'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
11:42:17 2015 +0200| [42a6a3841868b2150b7a13f35458bd9d2ffeb3e6] | committer: 
Michael Niedermayer

Merge commit '8016a1bd3b60e917e1b12748dd80c06c3462c286'

* commit '8016a1bd3b60e917e1b12748dd80c06c3462c286':
  rtmpdh: Remove an unnecessary check in the gcrypt/nettle dh_compute_key

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42a6a3841868b2150b7a13f35458bd9d2ffeb3e6
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rtmpdh: Add fate test for the DH handshake routine

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu May 28 
10:54:11 2015 +0300| [063f7467e4d14ab7fe01b2845dab60cc75df8b53] | committer: 
Martin Storsjö

rtmpdh: Add fate test for the DH handshake routine

This helps if these functions need to be implemented using another
crypto API.

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=063f7467e4d14ab7fe01b2845dab60cc75df8b53
---

 libavformat/Makefile   |1 +
 libavformat/rtmpdh.c   |  142 
 tests/fate/libavformat.mak |4 ++
 tests/ref/fate/rtmpdh  |3 +
 4 files changed, 150 insertions(+)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index dc4cfea..0323ad5 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -415,6 +415,7 @@ TESTPROGS = seek
\
 url \
 
 TESTPROGS-$(CONFIG_NETWORK)  += noproxy
+TESTPROGS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh
 
 TOOLS = aviocat \
 ismindex\
diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index f328e68..c29b563 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -157,6 +157,8 @@ static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
 
 void ff_dh_free(FF_DH *dh)
 {
+if (!dh)
+return;
 bn_free(dh->p);
 bn_free(dh->g);
 bn_free(dh->pub_key);
@@ -200,6 +202,8 @@ static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
 
 void ff_dh_free(FF_DH *dh)
 {
+if (!dh)
+return;
 DH_free(dh);
 }
 #endif
@@ -347,3 +351,141 @@ fail:
 return ret;
 }
 
+#ifdef TEST
+static int test_random_shared_secret(void)
+{
+FF_DH *peer1 = NULL, *peer2 = NULL;
+int ret;
+uint8_t pubkey1[128], pubkey2[128];
+uint8_t sharedkey1[128], sharedkey2[128];
+
+peer1 = ff_dh_init(1024);
+peer2 = ff_dh_init(1024);
+if (!peer1 || !peer2) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+if ((ret = ff_dh_generate_public_key(peer1)) < 0)
+goto fail;
+if ((ret = ff_dh_generate_public_key(peer2)) < 0)
+goto fail;
+if ((ret = ff_dh_write_public_key(peer1, pubkey1, sizeof(pubkey1))) < 0)
+goto fail;
+if ((ret = ff_dh_write_public_key(peer2, pubkey2, sizeof(pubkey2))) < 0)
+goto fail;
+if ((ret = ff_dh_compute_shared_secret_key(peer1, pubkey2, sizeof(pubkey2),
+   sharedkey1, 
sizeof(sharedkey1))) < 0)
+goto fail;
+if ((ret = ff_dh_compute_shared_secret_key(peer2, pubkey1, sizeof(pubkey1),
+   sharedkey2, 
sizeof(sharedkey2))) < 0)
+goto fail;
+if (memcmp(sharedkey1, sharedkey2, sizeof(sharedkey1))) {
+printf("Mismatched generated shared key\n");
+ret = AVERROR_INVALIDDATA;
+} else {
+printf("Generated shared key ok\n");
+}
+fail:
+ff_dh_free(peer1);
+ff_dh_free(peer2);
+return ret;
+}
+
+static const char *private_key =
+"976C18FCADC255B456564F74F3EEDA59D28AF6B744D743F2357BFD2404797EF896EF1A"
+"7C1CBEAAA3AB60AF3192D189CFF3F991C9CBBFD78119FCA2181384B94011943B6D6F28"
+"9E1B708E2D1A0C7771169293F03DA27E561F15F16F0AC9BC858C77A80FA98FD088A232"
+"19D08BE6F165DE0B02034B18705829FAD0ACB26A5B75EF";
+static const char *public_key =
+"F272ECF8362257C5D2C3CC2229CF9C0A03225BC109B1DBC76A68C394F256ACA3EF5F64"
+"FC270C26382BF315C19E97A76104A716FC998A651E8610A3AE6CF65D8FAE5D3F32EEA0"
+"0B32CB9609B494116A825D7142D17B88E3D20EDD98743DE29CF37A23A9F6A58B960591"
+"3157D5965FCB46DDA73A1F08DD897BAE88DFE6FC937CBA";
+static const uint8_t public_key_bin[] = {
+0xf2, 0x72, 0xec, 0xf8, 0x36, 0x22, 0x57, 0xc5, 0xd2, 0xc3, 0xcc, 0x22,
+0x29, 0xcf, 0x9c, 0x0a, 0x03, 0x22, 0x5b, 0xc1, 0x09, 0xb1, 0xdb, 0xc7,
+0x6a, 0x68, 0xc3, 0x94, 0xf2, 0x56, 0xac, 0xa3, 0xef, 0x5f, 0x64, 0xfc,
+0x27, 0x0c, 0x26, 0x38, 0x2b, 0xf3, 0x15, 0xc1, 0x9e, 0x97, 0xa7, 0x61,
+0x04, 0xa7, 0x16, 0xfc, 0x99, 0x8a, 0x65, 0x1e, 0x86, 0x10, 0xa3, 0xae,
+0x6c, 0xf6, 0x5d, 0x8f, 0xae, 0x5d, 0x3f, 0x32, 0xee, 0xa0, 0x0b, 0x32,
+0xcb, 0x96, 0x09, 0xb4, 0x94, 0x11, 0x6a, 0x82, 0x5d, 0x71, 0x42, 0xd1,
+0x7b, 0x88, 0xe3, 0xd2, 0x0e, 0xdd, 0x98, 0x74, 0x3d, 0xe2, 0x9c, 0xf3,
+0x7a, 0x23, 0xa9, 0xf6, 0xa5, 0x8b, 0x96, 0x05, 0x91, 0x31, 0x57, 0xd5,
+0x96, 0x5f, 0xcb, 0x46, 0xdd, 0xa7, 0x3a, 0x1f, 0x08, 0xdd, 0x89, 0x7b,
+0xae, 0x88, 0xdf, 0xe6, 0xfc, 0x93, 0x7c, 0xba
+};
+static const uint8_t peer_public_key[] = {
+0x58, 0x66, 0x05, 0x49, 0x94, 0x23, 0x2b, 0x66, 0x52, 0x13, 0xff, 0x46,
+0xf2, 0xb3, 0x79, 0xa9, 0xee, 0xae, 0x1a, 0x13, 0xf0, 0x71, 0x52, 0xfb,
+0x93, 0x4e, 0xee, 0x97, 0x05, 0x73, 0x50, 0x7d, 0xaf, 0x02, 0x07, 0x72,
+0xac, 0xdc, 0xa3, 0x95, 0x78, 0xee, 0x9

[FFmpeg-cvslog] avformat/mov: Avoid float usage in yuv_to_rgba()

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
12:06:51 2015 +0200| [e1b0019568430ee80c3bb474829897700ef31f1c] | committer: 
Michael Niedermayer

avformat/mov: Avoid float usage in yuv_to_rgba()

This avoids the possibility for rounding/precision differences between platforms

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1b0019568430ee80c3bb474829897700ef31f1c
---

 libavformat/mov.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 51cdd21..6072934 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1711,9 +1711,9 @@ static uint32_t yuv_to_rgba(uint32_t ycbcr)
 cr = (ycbcr >> 8)  & 0xFF;
 cb =  ycbcr& 0xFF;
 
-b = av_clip_uint8(1.164 * (y - 16)  + 2.018 * (cb - 
128));
-g = av_clip_uint8(1.164 * (y - 16) - 0.813 * (cr - 128) - 0.391 * (cb - 
128));
-r = av_clip_uint8(1.164 * (y - 16) + 1.596 * (cr - 128));
+b = av_clip_uint8((1164 * (y - 16) + 2018 * (cb - 
128)) / 1000);
+g = av_clip_uint8((1164 * (y - 16) -  813 * (cr - 128) -  391 * (cb - 
128)) / 1000);
+r = av_clip_uint8((1164 * (y - 16) + 1596 * (cr - 128)
) / 1000);
 
 return (r << 16) | (g << 8) | b;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/concatdec: Enable auto_convert by default

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue May 26 
22:16:43 2015 +0200| [3331213e2ac5a0fe5c574e9cd3da44df5e0d1d18] | committer: 
Michael Niedermayer

avformat/concatdec: Enable auto_convert by default

Users have no means to find out from a failure how to make it work
or is it preferred to check and print a warning for h264 concat without 
auto_convert ?

Reviewed-by: Nicolas George 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3331213e2ac5a0fe5c574e9cd3da44df5e0d1d18
---

 doc/demuxers.texi   |1 +
 libavformat/concatdec.c |2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index b7ddebb..35a1561 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -151,6 +151,7 @@ probed and 0 otherwise.
 @item auto_convert
 If set to 1, try to perform automatic conversions on packet data to make the
 streams concatenable.
+The default is 1.
 
 Currently, the only conversion is adding the h264_mp4toannexb bitstream
 filter to H.264 streams in MP4 format. This is necessary in particular if
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index f07cfd7..07db9f9 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -627,7 +627,7 @@ static const AVOption options[] = {
 { "safe", "enable safe mode",
   OFFSET(safe), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, DEC },
 { "auto_convert", "automatically convert bitstream format",
-  OFFSET(auto_convert), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
+  OFFSET(auto_convert), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC },
 { NULL }
 };
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/movenc: avoid floats in width/height/aspect ratio computations

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
12:36:55 2015 +0200| [14bc5704422415fddf1db5f5ae8e105183e0b582] | committer: 
Michael Niedermayer

avformat/movenc: avoid floats in width/height/aspect ratio computations

This avoids the possibility for rounding/precision differences between platforms

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14bc5704422415fddf1db5f5ae8e105183e0b582
---

 libavformat/movenc.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 6a4e16a..8b0a579 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2368,10 +2368,12 @@ static int mov_write_tkhd_tag(AVIOContext *pb, 
MOVMuxContext *mov,
 avio_wb32(pb, track->enc->width << 16);
 avio_wb32(pb, track->height << 16);
 } else {
-double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio);
-if (!sample_aspect_ratio || track->height != track->enc->height)
-sample_aspect_ratio = 1;
-avio_wb32(pb, sample_aspect_ratio * track->enc->width * 0x1);
+int64_t track_width_1616 = av_rescale(st->sample_aspect_ratio.num,
+  track->enc->width * 
0x1LL,
+  st->sample_aspect_ratio.den);
+if (!track_width_1616 || track->height != track->enc->height)
+track_width_1616 = track->enc->width * 0x1;
+avio_wb32(pb, track_width_1616);
 avio_wb32(pb, track->height * 0x1);
 }
 } else {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/movenc: Check that track_width_1616 fits within the available 32bit before storing it

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
12:54:37 2015 +0200| [061a592b9cb0071d624d230ddb5d00a640df05d1] | committer: 
Michael Niedermayer

avformat/movenc: Check that track_width_1616 fits within the available 32bit 
before storing it

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=061a592b9cb0071d624d230ddb5d00a640df05d1
---

 libavformat/movenc.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8b0a579..5491082 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2371,7 +2371,9 @@ static int mov_write_tkhd_tag(AVIOContext *pb, 
MOVMuxContext *mov,
 int64_t track_width_1616 = av_rescale(st->sample_aspect_ratio.num,
   track->enc->width * 
0x1LL,
   st->sample_aspect_ratio.den);
-if (!track_width_1616 || track->height != track->enc->height)
+if (!track_width_1616 ||
+track->height != track->enc->height ||
+track_width_1616 > UINT32_MAX)
 track_width_1616 = track->enc->width * 0x1;
 avio_wb32(pb, track_width_1616);
 avio_wb32(pb, track->height * 0x1);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/ac3_parser: Avoid floats in bitrate computation

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
12:59:35 2015 +0200| [f86e7c5d00cc426833c838f6ec6051d411a8bf80] | committer: 
Michael Niedermayer

avcodec/ac3_parser: Avoid floats in bitrate computation

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f86e7c5d00cc426833c838f6ec6051d411a8bf80
---

 libavcodec/ac3_parser.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index 131e180..678f08d 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -140,8 +140,8 @@ int avpriv_ac3_parse_header2(GetBitContext *gbc, 
AC3HeaderInfo **phdr)
 hdr->channel_mode = get_bits(gbc, 3);
 hdr->lfe_on = get_bits1(gbc);
 
-hdr->bit_rate = (uint32_t)(8.0 * hdr->frame_size * hdr->sample_rate /
-(hdr->num_blocks * 256.0));
+hdr->bit_rate = 8LL * hdr->frame_size * hdr->sample_rate /
+(hdr->num_blocks * 256);
 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
 }
 hdr->channel_layout = avpriv_ac3_channel_layout_tab[hdr->channel_mode];

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/mpegvideo: Use FFSWAP to exchange pointers

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
14:03:07 2015 +0200| [403940de241e8f15ec9eae3e69c6c2f423bafcf5] | committer: 
Michael Niedermayer

avcodec/mpegvideo: Use FFSWAP to exchange pointers

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=403940de241e8f15ec9eae3e69c6c2f423bafcf5
---

 libavcodec/mpegvideo.c |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index e798565..fb8570c 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -846,10 +846,7 @@ static int init_duplicate_context(MpegEncContext *s)
 }
 if (s->avctx->codec_tag == AV_RL32("VCR2")) {
 // exchange uv
-int16_t (*tmp)[64];
-tmp   = s->pblocks[4];
-s->pblocks[4] = s->pblocks[5];
-s->pblocks[5] = tmp;
+FFSWAP(void *, s->pblocks[4], s->pblocks[5]);
 }
 
 if (s->out_format == FMT_H263) {
@@ -927,10 +924,7 @@ int ff_update_duplicate_context(MpegEncContext *dst, 
MpegEncContext *src)
 }
 if (dst->avctx->codec_tag == AV_RL32("VCR2")) {
 // exchange uv
-int16_t (*tmp)[64];
-tmp = dst->pblocks[4];
-dst->pblocks[4] = dst->pblocks[5];
-dst->pblocks[5] = tmp;
+FFSWAP(void *, dst->pblocks[4], dst->pblocks[5]);
 }
 if (!dst->edge_emu_buffer &&
 (ret = frame_size_alloc(dst, dst->linesize)) < 0) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] mov: fix DTS calculation for samples with negative stts duration

2015-05-29 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Wed May 27 23:57:50 2015 +0200| [153639cb9cfacfdb094f0fa42012fa5c547246f4] | 
committer: Andreas Cadhalpun

mov: fix DTS calculation for samples with negative stts duration

A negative sample duration is invalid according to the spec, but there
are samples that use it for the DTS calculation, e.g.:
http://files.1f0.de/samples/mp4-negative-stts-problem.mp4

These currently get out of A/V sync.

Also change the logging type to AV_LOG_WARNING, because decoding the
sample can continue.

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=153639cb9cfacfdb094f0fa42012fa5c547246f4
---

 libavformat/mov.c |   29 +++--
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6072934..5cea5fd 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2234,12 +2234,6 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 sample_count=avio_rb32(pb);
 sample_duration = avio_rb32(pb);
 
-/* sample_duration < 0 is invalid based on the spec */
-if (sample_duration < 0) {
-av_log(c->fc, AV_LOG_ERROR, "Invalid SampleDelta %d in STTS, at %d 
st:%d\n",
-   sample_duration, i, c->fc->nb_streams-1);
-sample_duration = 1;
-}
 if (sample_count < 0) {
 av_log(c->fc, AV_LOG_ERROR, "Invalid sample_count=%d\n", 
sample_count);
 return AVERROR_INVALIDDATA;
@@ -2439,10 +2433,13 @@ static void mov_build_index(MOVContext *mov, AVStream 
*st)
 unsigned int distance = 0;
 unsigned int rap_group_index = 0;
 unsigned int rap_group_sample = 0;
+int64_t last_dts = 0;
+int64_t dts_correction = 0;
 int rap_group_present = sc->rap_group_count && sc->rap_group;
 int key_off = (sc->keyframe_count && sc->keyframes[0] > 0) || 
(sc->stps_count && sc->stps_data[0] > 0);
 
 current_dts -= sc->dts_shift;
+last_dts = current_dts;
 
 if (!sc->sample_count || st->nb_index_entries)
 return;
@@ -2522,7 +2519,27 @@ static void mov_build_index(MOVContext *mov, AVStream 
*st)
 
 current_offset += sample_size;
 stream_size += sample_size;
+
+/* A negative sample duration is invalid based on the spec,
+ * but some samples need it to correct the DTS. */
+if (sc->stts_data[stts_index].duration < 0) {
+av_log(mov->fc, AV_LOG_WARNING,
+   "Invalid SampleDelta %d in STTS, at %d st:%d\n",
+   sc->stts_data[stts_index].duration, stts_index,
+   st->index);
+dts_correction += sc->stts_data[stts_index].duration - 1;
+sc->stts_data[stts_index].duration = 1;
+}
 current_dts += sc->stts_data[stts_index].duration;
+if (!dts_correction || current_dts + dts_correction > 
last_dts) {
+current_dts += dts_correction;
+dts_correction = 0;
+} else {
+/* Avoid creating non-monotonous DTS */
+dts_correction += current_dts - last_dts - 1;
+current_dts = last_dts + 1;
+}
+last_dts = current_dts;
 distance++;
 stts_sample++;
 current_sample++;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libavutil: Cosmetic changes to fixed_dsp file.

2015-05-29 Thread Nedeljko Babic
ffmpeg | branch: master | Nedeljko Babic  | Fri May 
29 15:46:20 2015 +0200| [e374405d8e821e292ebde827d9b30257b0ff75eb] | committer: 
Michael Niedermayer

libavutil: Cosmetic changes to fixed_dsp file.

Names of functions vector_fmul_window_fixed_c and
vector_fmul_window_fixed_scaled_c are changed by removing "_fixed"
from the name since it is redundant.

Signed-off-by: Nedeljko Babic 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e374405d8e821e292ebde827d9b30257b0ff75eb
---

 libavutil/fixed_dsp.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavutil/fixed_dsp.c b/libavutil/fixed_dsp.c
index 9f2e841..e0ea981 100644
--- a/libavutil/fixed_dsp.c
+++ b/libavutil/fixed_dsp.c
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Author:  Nedeljko Babic (nba...@mips.com)
+ * Author:  Nedeljko Babic (nedeljko.babic imgtec com)
  *
  * This file is part of FFmpeg.
  *
@@ -47,7 +47,7 @@
 
 #include "fixed_dsp.h"
 
-static void vector_fmul_window_fixed_scaled_c(int16_t *dst, const int32_t 
*src0,
+static void vector_fmul_window_scaled_c(int16_t *dst, const int32_t *src0,
const int32_t *src1, const int32_t *win,
int len, uint8_t bits)
 {
@@ -68,7 +68,7 @@ static void vector_fmul_window_fixed_scaled_c(int16_t *dst, 
const int32_t *src0,
 }
 }
 
-static void vector_fmul_window_fixed_c(int32_t *dst, const int32_t *src0,
+static void vector_fmul_window_c(int32_t *dst, const int32_t *src0,
const int32_t *src1, const int32_t *win,
int len)
 {
@@ -95,8 +95,8 @@ AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
 if (!fdsp)
 return NULL;
 
-fdsp->vector_fmul_window_scaled = vector_fmul_window_fixed_scaled_c;
-fdsp->vector_fmul_window = vector_fmul_window_fixed_c;
+fdsp->vector_fmul_window_scaled = vector_fmul_window_scaled_c;
+fdsp->vector_fmul_window = vector_fmul_window_c;
 
 return fdsp;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] build: add configure option pkgconfigdir

2015-05-29 Thread Ingo Brückl
ffmpeg | branch: master | Ingo Brückl  | Fri May 29 
16:08:36 2015 +0200| [083b1a32d5306c76d2c096d6bc3f1b7510fd7cc9] | committer: 
Michael Niedermayer

build: add configure option pkgconfigdir

This allows the user to override the directory for the installation
of the pkg-config files (from the default LIBDIR/pkgconfig).

It follows the usual behaviour of Makefiles generated by automake.

Signed-off-by: Ingo Brückl 
Reviewed-by: Andreas Cadhalpun 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=083b1a32d5306c76d2c096d6bc3f1b7510fd7cc9
---

 configure   |4 
 library.mak |6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index a90fef1..43f281b 100755
--- a/configure
+++ b/configure
@@ -87,6 +87,7 @@ Standard options:
   --shlibdir=DIR   install shared libs in DIR [LIBDIR]
   --incdir=DIR install includes in DIR [PREFIX/include]
   --mandir=DIR install man page in DIR [PREFIX/share/man]
+  --pkgconfigdir=DIR   install pkg-config files in DIR [LIBDIR/pkgconfig]
   --enable-rpath   use rpath to allow installing libraries in paths
not part of the dynamic linker search path
use rpath when linking programs [USE WITH CARE]
@@ -1954,6 +1955,7 @@ PATHS_LIST="
 incdir
 libdir
 mandir
+pkgconfigdir
 prefix
 shlibdir
 "
@@ -4487,6 +4489,7 @@ check_cpp_condition stdlib.h "defined(__PIC__) || 
defined(__pic__) || defined(PI
 
 set_default libdir
 : ${shlibdir_default:="$libdir"}
+: ${pkgconfigdir_default:="$libdir/pkgconfig"}
 
 set_default $PATHS_LIST
 set_default nm
@@ -5799,6 +5802,7 @@ BINDIR=\$(DESTDIR)$bindir
 DATADIR=\$(DESTDIR)$datadir
 DOCDIR=\$(DESTDIR)$docdir
 MANDIR=\$(DESTDIR)$mandir
+PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
 SRC_PATH=$source_path
 ifndef MAIN_MAKEFILE
 SRC_PATH:=\$(SRC_PATH:.%=..%)
diff --git a/library.mak b/library.mak
index e23abd2..7c26024 100644
--- a/library.mak
+++ b/library.mak
@@ -90,8 +90,8 @@ install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) 
$(BUILT_HEADERS))
$$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
 
 install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(FULLNAME).pc
-   $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
-   $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
+   $(Q)mkdir -p "$(PKGCONFIGDIR)"
+   $$(INSTALL) -m 644 $$^ "$(PKGCONFIGDIR)"
 
 uninstall-libs::
-$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
@@ -103,7 +103,7 @@ uninstall-libs::
 
 uninstall-headers::
$(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
-   $(RM) "$(LIBDIR)/pkgconfig/lib$(FULLNAME).pc"
+   $(RM) "$(PKGCONFIGDIR)/lib$(FULLNAME).pc"
-rmdir "$(INCINSTDIR)"
 endef
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] configure: Fix showcqt fft dependancy

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri May 29 
21:07:58 2015 +0200| [bedb5d587b5f1fc962e2786c0ea8274ddea6c684] | committer: 
Michael Niedermayer

configure: Fix showcqt fft dependancy

Found-by: Muhammad Faiz 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bedb5d587b5f1fc962e2786c0ea8274ddea6c684
---

 configure |2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 43f281b..afa3b64 100755
--- a/configure
+++ b/configure
@@ -2698,6 +2698,8 @@ sab_filter_deps="gpl swscale"
 scale_filter_deps="swscale"
 select_filter_select="pixelutils"
 smartblur_filter_deps="gpl swscale"
+showcqt_filter_deps="avcodec"
+showcqt_filter_select="fft"
 showspectrum_filter_deps="avcodec"
 showspectrum_filter_select="rdft"
 spp_filter_deps="gpl avcodec"

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavf/tls: Support Secure Transport

2015-05-29 Thread Rodger Combs
ffmpeg | branch: master | Rodger Combs  | Thu May 28 
14:46:16 2015 -0500| [f24d92badadc365f90b5737d6b0234779b6c33bf] | committer: 
Michael Niedermayer

lavf/tls: Support Secure Transport

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f24d92badadc365f90b5737d6b0234779b6c33bf
---

 Changelog |1 +
 configure |   14 +-
 libavformat/Makefile  |1 +
 libavformat/allformats.c  |1 +
 libavformat/avio.c|4 +-
 libavformat/tls.h |2 +-
 libavformat/tls_securetransport.c |  393 +
 libavformat/version.h |4 +-
 8 files changed, 413 insertions(+), 7 deletions(-)

diff --git a/Changelog b/Changelog
index 3f47490..c73f1dd 100644
--- a/Changelog
+++ b/Changelog
@@ -23,6 +23,7 @@ version :
 - VP9 high bit-depth and extended colorspaces decoding support
 - WebPAnimEncoder API when available for encoding and muxing WebP
 - Direct3D11-accelerated decoding
+- Support Secure Transport
 
 
 version 2.6:
diff --git a/configure b/configure
index afa3b64..fb7ec68 100755
--- a/configure
+++ b/configure
@@ -276,6 +276,8 @@ External library support:
   --enable-openssl enable openssl, needed for https support
if gnutls is not used [no]
   --disable-sdldisable sdl [autodetect]
+  --disable-securetransport disable Secure Transport, needed for TLS support
+   on OSX if openssl and gnutls are not used 
[autodetect]
   --enable-x11grab enable X11 grabbing (legacy) [no]
   --disable-xlib   disable xlib [autodetect]
   --disable-zlib   disable zlib [autodetect]
@@ -1424,6 +1426,7 @@ EXTERNAL_LIBRARY_LIST="
 opengl
 openssl
 sdl
+securetransport
 x11grab
 xlib
 zlib
@@ -2636,9 +2639,10 @@ sctp_protocol_deps="struct_sctp_event_subscribe"
 sctp_protocol_select="network"
 srtp_protocol_select="rtp_protocol"
 tcp_protocol_select="network"
-tls_gnutls_protocol_deps="gnutls"
-tls_openssl_protocol_deps="openssl !tls_gnutls_protocol"
-tls_protocol_deps_any="tls_gnutls_protocol tls_openssl_protocol"
+tls_securetransport_protocol_deps="securetransport"
+tls_gnutls_protocol_deps="gnutls !tls_securetransport_protocol"
+tls_openssl_protocol_deps="openssl !tls_securetransport_protocol 
!tls_gnutls_protocol"
+tls_protocol_deps_any="tls_securetransport_protocol tls_gnutls_protocol 
tls_openssl_protocol"
 tls_protocol_select="tcp_protocol"
 udp_protocol_select="network"
 udplite_protocol_select="network"
@@ -5213,6 +5217,10 @@ if ! disabled sdl; then
 fi
 enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
 
+disabled securetransport || { check_func SecIdentityCreate 
"-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
+check_lib2 Security/SecureTransport.h SSLCreateContext 
"-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
+enable securetransport; }
+
 makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
 enabled makeinfo && (makeinfo --version | \
  grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 142d69c..aab3b3b 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -523,6 +523,7 @@ OBJS-$(CONFIG_SUBFILE_PROTOCOL)  += subfile.o
 OBJS-$(CONFIG_TCP_PROTOCOL)  += tcp.o
 OBJS-$(CONFIG_TLS_GNUTLS_PROTOCOL)   += tls_gnutls.o tls.o
 OBJS-$(CONFIG_TLS_OPENSSL_PROTOCOL)  += tls_openssl.o tls.o
+OBJS-$(CONFIG_TLS_SECURETRANSPORT_PROTOCOL) += tls_securetransport.o tls.o
 OBJS-$(CONFIG_UDP_PROTOCOL)  += udp.o
 OBJS-$(CONFIG_UDPLITE_PROTOCOL)  += udp.o
 OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 3938bfa..e58ddd5 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -377,6 +377,7 @@ void av_register_all(void)
 REGISTER_PROTOCOL(SRTP, srtp);
 REGISTER_PROTOCOL(SUBFILE,  subfile);
 REGISTER_PROTOCOL(TCP,  tcp);
+REGISTER_PROTOCOL(TLS_SECURETRANSPORT, tls_securetransport);
 REGISTER_PROTOCOL(TLS_GNUTLS,   tls_gnutls);
 REGISTER_PROTOCOL(TLS_OPENSSL,  tls_openssl);
 REGISTER_PROTOCOL(UDP,  udp);
diff --git a/libavformat/avio.c b/libavformat/avio.c
index a990ea2..deeb87f 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -263,7 +263,9 @@ int ffurl_alloc(URLContext **puc, const char *filename, int 
flags,
 
 *puc = NULL;
 if (av_strstart(filename, "https:", NULL))
-av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile with 
openssl or gnutls enabled.\n");
+av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile with 
"
+ "openssl, gnutls,\n"
+  

[FFmpeg-cvslog] rtmpdh: Generate the whole private exponent using av_get_random_seed() with nettle/gmp

2015-05-29 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Fri May 29 
10:14:39 2015 +0300| [b2f0f37d242f1194fe1f886557cf6cefdf98caf6] | committer: 
Martin Storsjö

rtmpdh: Generate the whole private exponent using av_get_random_seed() with 
nettle/gmp

Don't use a PRNG for generating it; that defies the intended use
within the cryptograhic handshake.

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2f0f37d242f1194fe1f886557cf6cefdf98caf6
---

 libavformat/rtmpdh.c |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index 5cc66c9..12a64bc 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -81,13 +81,15 @@
 ret = 1;\
 } while (0)
 #define bn_modexp(bn, y, q, p)  mpz_powm(bn, y, q, p)
-#define bn_random(bn, num_bits) \
-do {\
-gmp_randstate_t rs; \
-gmp_randinit_mt(rs);\
-gmp_randseed_ui(rs, av_get_random_seed());  \
-mpz_urandomb(bn, rs, num_bits); \
-gmp_randclear(rs);  \
+#define bn_random(bn, num_bits)   \
+do {  \
+int bits = num_bits;  \
+mpz_set_ui(bn, 0);\
+for (bits = num_bits; bits > 0; bits -= 32) { \
+mpz_mul_2exp(bn, bn, 32); \
+mpz_add_ui(bn, bn, av_get_random_seed()); \
+} \
+mpz_fdiv_r_2exp(bn, bn, num_bits);\
 } while (0)
 #elif CONFIG_GCRYPT
 #define bn_new(bn)  bn = gcry_mpi_new(1)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'b2f0f37d242f1194fe1f886557cf6cefdf98caf6'

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat May 30 
00:59:54 2015 +0200| [2e15f07cfddd0bfdc049d94c68b0198d086956b7] | committer: 
Michael Niedermayer

Merge commit 'b2f0f37d242f1194fe1f886557cf6cefdf98caf6'

* commit 'b2f0f37d242f1194fe1f886557cf6cefdf98caf6':
  rtmpdh: Generate the whole private exponent using av_get_random_seed() with 
nettle/gmp

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e15f07cfddd0bfdc049d94c68b0198d086956b7
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/h264dec: Add ff_tlog() with trace information about h264 probing

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat May 30 
03:57:20 2015 +0200| [aa9c6b6986eac8a44d7828a8653d4d015384b7da] | committer: 
Michael Niedermayer

avformat/h264dec: Add ff_tlog() with trace information about h264 probing

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa9c6b6986eac8a44d7828a8653d4d015384b7da
---

 libavformat/h264dec.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/h264dec.c b/libavformat/h264dec.c
index 4adc234..d1d37ca 100644
--- a/libavformat/h264dec.c
+++ b/libavformat/h264dec.c
@@ -21,6 +21,7 @@
 
 #include "avformat.h"
 #include "rawdec.h"
+#include "libavcodec/internal.h"
 
 static int h264_probe(AVProbeData *p)
 {
@@ -70,6 +71,7 @@ static int h264_probe(AVProbeData *p)
 }
 }
 }
+ff_tlog(NULL, "sps:%d pps:%d idr:%d sli:%d res:%d\n", sps, pps, idr, sli, 
res);
 
 if (sps && pps && (idr || sli > 3) && res < (sps + pps + idr))
 return AVPROBE_SCORE_EXTENSION + 1;  // 1 more than .mpg

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/h264dec: Fix detection of invalid h264 with 0x100 startcodes

2015-05-29 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat May 30 
03:53:32 2015 +0200| [dae89802a6eeae89519334d78cf2a79da4060273] | committer: 
Michael Niedermayer

avformat/h264dec: Fix detection of invalid h264 with 0x100 startcodes

Fies Ticket4325

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dae89802a6eeae89519334d78cf2a79da4060273
---

 libavformat/h264dec.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/h264dec.c b/libavformat/h264dec.c
index 76073dd..4adc234 100644
--- a/libavformat/h264dec.c
+++ b/libavformat/h264dec.c
@@ -47,8 +47,10 @@ static int h264_probe(AVProbeData *p)
 return 0;
 if (ref_zero[type] == -1 && !ref_idc)
 return 0;
-if (ref_zero[type] == 2)
-res++;
+if (ref_zero[type] == 2) {
+if (!(code == 0x100 && !p->buf[i + 1] && !p->buf[i + 2]))
+res++;
+}
 
 switch (type) {
 case 1:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/dvbsubdec: Fix buf_size check in dvbsub_parse_display_definition_segment()

2015-05-29 Thread banastasov
ffmpeg | branch: master | banastasov  | Sat May 30 
04:28:39 2015 +0200| [debf4d6e67dfb29f3d71683add429c588828f8e8] | committer: 
Michael Niedermayer

avcodec/dvbsubdec: Fix buf_size check in 
dvbsub_parse_display_definition_segment()

Fixes Ticket4326

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=debf4d6e67dfb29f3d71683add429c588828f8e8
---

 libavcodec/dvbsubdec.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 7c3dedf..e268e2a 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1504,10 +1504,10 @@ static int 
dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
 avctx->height = display_def->height;
 }
 
-if (buf_size < 13)
-return AVERROR_INVALIDDATA;
-
 if (info_byte & 1<<3) { // display_window_flag
+if (buf_size < 13)
+return AVERROR_INVALIDDATA;
+
 display_def->x = bytestream_get_be16(&buf);
 display_def->width  = bytestream_get_be16(&buf) - display_def->x + 1;
 display_def->y = bytestream_get_be16(&buf);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog