-rw-r--r-- | audio_hw.c | 70 | ||||
-rw-r--r-- | audio_hwsync.c | 34 | ||||
-rw-r--r-- | audio_hwsync.h | 13 |
3 files changed, 69 insertions, 48 deletions
diff --git a/audio_hwsync.h b/audio_hwsync.h index c78cab0..b65e2ad 100644 --- a/audio_hwsync.h +++ b/audio_hwsync.h @@ -30,17 +30,19 @@ #define HW_SYNC_STATE_HEADER 0 #define HW_SYNC_STATE_BODY 1 #define HW_SYNC_STATE_RESYNC 2 +#define HW_SYNC_HEADER_CNT 20 + #define APTS_DISCONTINUE_THRESHOLD (90000) #define APTS_DISCONTINUE_THRESHOLD_MIN (90000/1000*100) #define APTS_DISCONTINUE_THRESHOLD_MAX (5*90000) typedef struct audio_hwsync { - uint8_t hw_sync_header[16]; + uint8_t hw_sync_header[HW_SYNC_HEADER_CNT]; size_t hw_sync_header_cnt; int hw_sync_state; - size_t hw_sync_body_cnt; - int hw_sync_frame_size; - uint8_t hw_sync_body_buf[4096]; + uint32_t hw_sync_body_cnt; + uint32_t hw_sync_frame_size; + uint8_t hw_sync_body_buf[8192]; uint8_t body_align[64]; uint8_t body_align_cnt; bool first_apts_flag;//flag to indicate set first apts @@ -52,7 +54,8 @@ static inline bool hwsync_header_valid(uint8_t *header) return (header[0] == 0x55) && (header[1] == 0x55) && (header[2] == 0x00) && - (header[3] == 0x01); + //(header[3] == 0x01 || header[3] == 0x02); + (header[3] == 0x02); } static inline uint64_t hwsync_header_get_pts(uint8_t *header) |