Skip to content

Commit 4e1a89c

Browse files
committed
fix: amf write date
1 parent 4bc6457 commit 4e1a89c

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

libflv/include/flv-proto.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#define FLV_AUDIO_AAC (10 << 4)
2121
#define FLV_AUDIO_SPEEX (11 << 4)
2222
#define FLV_AUDIO_AC3 (12 << 4) // enhanced rtmp v2
23-
#define FLV_AUDIO_OPUS (13 << 4)
23+
#define FLV_AUDIO_OPUS (13 << 4) // opus-codec.org
2424
#define FLV_AUDIO_MP3_8K (14 << 4) // MP3 8 kHz
2525
#define FLV_AUDIO_DEVIDE (15 << 4) // Device-specific sound
2626
#define FLV_AUDIO_ASC (0x1000 | FLV_AUDIO_AAC) // AudioSpecificConfig(ISO-14496-3)
27-
#define FLV_AUDIO_OPUS_HEAD (0x1100 | FLV_AUDIO_OPUS) // opus-codec.org
27+
#define FLV_AUDIO_OPUS_HEAD (0x1100 | FLV_AUDIO_OPUS) // https://datatracker.ietf.org/doc/html/rfc7845#section-5.1
2828
#define FLV_AUDIO_FLAC_HEAD (0x1200 | FLV_AUDIO_FLAC) // xiph.org/flac
2929

3030
// FLV Video Type

libflv/include/opus-head.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct opus_head_t
2121
uint8_t channel_mapping[8];
2222
};
2323

24+
/// @param[out] data https://datatracker.ietf.org/doc/html/rfc7845#section-5.1
2425
/// @return >0-ok, <=0-error
2526
int opus_head_save(const struct opus_head_t* opus, uint8_t* data, size_t bytes);
2627
/// @return >0-ok, <=0-error

libflv/source/amf0.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ uint8_t* AMFWriteDate(uint8_t* ptr, const uint8_t* end, double milliseconds, int
153153

154154
AMFWriteDouble(ptr, end, milliseconds);
155155
*ptr = AMF_DATE; // rewrite to date
156-
return AMFWriteInt16(ptr + 8, end, timezone);
156+
return AMFWriteInt16(ptr + 9, end, timezone);
157157
}
158158

159159
uint8_t* AMFWriteNamedBoolean(uint8_t* ptr, const uint8_t* end, const char* name, size_t length, uint8_t value)

libflv/source/opus-head.c

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <string.h>
44
#include <assert.h>
55

6+
// https://datatracker.ietf.org/doc/html/rfc7845#section-5.1
67
// http://www.opus-codec.org/docs/opus_in_isobmff.html
78
// 4.3.2 Opus Specific Box
89
/*

0 commit comments

Comments
 (0)