如下,在wasm web端js通过ptr地址移位取值会出问题
到了height的32bits都没问题,但是一直取不到 下面的 v_duration和之后的值,
按理说地址是正确寻址匹配的
typedef struct MediaInfo {
uint32_t a_sample_rate;
uint32_t a_channel;
double fps;
uint32_t gop;
uint32_t width; //= -1;
uint32_t height; //= -1;
double v_duration; //= -1
double a_duration; //= -1
double duration; //= -1
} MediaInfo;
之后改了以下,
把double放在一起,并且之后的寻址没有出现 1/2这种分数形式就没问题了
typedef struct MediaInfo {
uint32_t a_sample_rate;
uint32_t a_channel;
double fps;
double v_duration; //= -1
double a_duration; //= -1
double duration; //= -1
uint32_t gop;
uint32_t width; //= -1;
uint32_t height; //= -1;
} MediaInfo;
网友评论