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:
parent
52596a0b04
commit
43ebd5958d
3 changed files with 26 additions and 16 deletions
|
@ -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;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue