Skip to content

Commit

Permalink
fix: amf write date
Browse files Browse the repository at this point in the history
  • Loading branch information
ireader committed Sep 21, 2024
1 parent 4bc6457 commit 4e1a89c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libflv/include/flv-proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#define FLV_AUDIO_AAC (10 << 4)
#define FLV_AUDIO_SPEEX (11 << 4)
#define FLV_AUDIO_AC3 (12 << 4) // enhanced rtmp v2
#define FLV_AUDIO_OPUS (13 << 4)
#define FLV_AUDIO_OPUS (13 << 4) // opus-codec.org
#define FLV_AUDIO_MP3_8K (14 << 4) // MP3 8 kHz
#define FLV_AUDIO_DEVIDE (15 << 4) // Device-specific sound
#define FLV_AUDIO_ASC (0x1000 | FLV_AUDIO_AAC) // AudioSpecificConfig(ISO-14496-3)
#define FLV_AUDIO_OPUS_HEAD (0x1100 | FLV_AUDIO_OPUS) // opus-codec.org
#define FLV_AUDIO_OPUS_HEAD (0x1100 | FLV_AUDIO_OPUS) // https://datatracker.ietf.org/doc/html/rfc7845#section-5.1
#define FLV_AUDIO_FLAC_HEAD (0x1200 | FLV_AUDIO_FLAC) // xiph.org/flac

// FLV Video Type
Expand Down
1 change: 1 addition & 0 deletions libflv/include/opus-head.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct opus_head_t
uint8_t channel_mapping[8];
};

/// @param[out] data https://datatracker.ietf.org/doc/html/rfc7845#section-5.1
/// @return >0-ok, <=0-error
int opus_head_save(const struct opus_head_t* opus, uint8_t* data, size_t bytes);
/// @return >0-ok, <=0-error
Expand Down
2 changes: 1 addition & 1 deletion libflv/source/amf0.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ uint8_t* AMFWriteDate(uint8_t* ptr, const uint8_t* end, double milliseconds, int

AMFWriteDouble(ptr, end, milliseconds);
*ptr = AMF_DATE; // rewrite to date
return AMFWriteInt16(ptr + 8, end, timezone);
return AMFWriteInt16(ptr + 9, end, timezone);
}

uint8_t* AMFWriteNamedBoolean(uint8_t* ptr, const uint8_t* end, const char* name, size_t length, uint8_t value)
Expand Down
1 change: 1 addition & 0 deletions libflv/source/opus-head.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <string.h>
#include <assert.h>

// https://datatracker.ietf.org/doc/html/rfc7845#section-5.1
// http://www.opus-codec.org/docs/opus_in_isobmff.html
// 4.3.2 Opus Specific Box
/*
Expand Down

0 comments on commit 4e1a89c

Please sign in to comment.