1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix bug that only one stream can be encrypted..

This commit is contained in:
Harlan 2018-04-03 22:00:32 +08:00
parent 52596a0b04
commit 43ebd5958d
3 changed files with 26 additions and 16 deletions

View file

@ -1578,18 +1578,17 @@ public:
* Used for HLS Encryption
*/
#define HLS_AES_ENCRYPT_BLOCK_LENGTH 188*4
static char tmpbuf[HLS_AES_ENCRYPT_BLOCK_LENGTH] = {0};
static int buflength = 0;
class SrsEncFileWriter: public SrsFileWriter
{
public:
SrsEncFileWriter()
{
memset(iv,0,16);
memset(tmpbuf,0,HLS_AES_ENCRYPT_BLOCK_LENGTH);
buflength = 0;
}
virtual ~SrsEncFileWriter(){}
@ -1602,6 +1601,12 @@ public:
private:
AES_KEY key;
unsigned char iv[16];
private:
char tmpbuf[HLS_AES_ENCRYPT_BLOCK_LENGTH];
int buflength;
};
/**