Commit 147a45fc authored by Michael Niedermayer's avatar Michael Niedermayer

framecrcenc: workaround design flaw in sidedata palette

This should be reverted once palettes are dealt with in a endian independant way
in packets
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a0adeb1f
...@@ -34,13 +34,22 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) ...@@ -34,13 +34,22 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
if (pkt->flags != AV_PKT_FLAG_KEY) if (pkt->flags != AV_PKT_FLAG_KEY)
av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags); av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags);
if (pkt->side_data_elems) { if (pkt->side_data_elems) {
int i; int i, j;
av_strlcatf(buf, sizeof(buf), ", S=%d", pkt->side_data_elems); av_strlcatf(buf, sizeof(buf), ", S=%d", pkt->side_data_elems);
for (i=0; i<pkt->side_data_elems; i++) { for (i=0; i<pkt->side_data_elems; i++) {
uint32_t side_data_crc = av_adler32_update(0, uint32_t side_data_crc = 0;
pkt->side_data[i].data, if (HAVE_BIGENDIAN && AV_PKT_DATA_PALETTE == pkt->side_data[i].type) {
pkt->side_data[i].size); for (j=0; j<pkt->side_data[i].size; j++) {
side_data_crc = av_adler32_update(side_data_crc,
pkt->side_data[i].data + (j^3),
1);
}
} else {
side_data_crc = av_adler32_update(0,
pkt->side_data[i].data,
pkt->side_data[i].size);
}
av_strlcatf(buf, sizeof(buf), ", %8d, 0x%08x", pkt->side_data[i].size, side_data_crc); av_strlcatf(buf, sizeof(buf), ", %8d, 0x%08x", pkt->side_data[i].size, side_data_crc);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment