diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index ee355f258f..e3991372f9 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -2060,30 +2060,30 @@ static void handle_realaudio(demuxer_t *demuxer, mkv_track_t *track, int bs = sph * w * 2 / 96; // nibbles per subpacket // Perform reordering for (n = 0; n < 38; n++) { - int i = bs * sipr_swaps[n][0]; // 77 max - int o = bs * sipr_swaps[n][1]; // 95 max + unsigned int i = bs * sipr_swaps[n][0]; // 77 max + unsigned int o = bs * sipr_swaps[n][1]; // 95 max // swap nibbles of block 'i' with 'o' for (int j = 0; j < bs; j++) { if (i / 2 >= audiobuf_size || o / 2 >= audiobuf_size) goto error; int x = (i & 1) ? - (track->audio_buf[i >> 1] >> 4) : - (track->audio_buf[i >> 1] & 0x0F); + (track->audio_buf[i / 2] >> 4) : + (track->audio_buf[i / 2] & 0x0F); int y = (o & 1) ? - (track->audio_buf[o >> 1] >> 4) : - (track->audio_buf[o >> 1] & 0x0F); + (track->audio_buf[o / 2] >> 4) : + (track->audio_buf[o / 2] & 0x0F); if (o & 1) - track->audio_buf[o >> 1] = - (track->audio_buf[o >> 1] & 0x0F) | (x << 4); + track->audio_buf[o / 2] = + (track->audio_buf[o / 2] & 0x0F) | (x << 4); else - track->audio_buf[o >> 1] = - (track->audio_buf[o >> 1] & 0xF0) | x; + track->audio_buf[o / 2] = + (track->audio_buf[o / 2] & 0xF0) | x; if (i & 1) - track->audio_buf[i >> 1] = - (track->audio_buf[i >> 1] & 0x0F) | (y << 4); + track->audio_buf[i / 2] = + (track->audio_buf[i / 2] & 0x0F) | (y << 4); else - track->audio_buf[i >> 1] = - (track->audio_buf[i >> 1] & 0xF0) | y; + track->audio_buf[i / 2] = + (track->audio_buf[i / 2] & 0xF0) | y; ++i; ++o; } diff --git a/demux/ebml.c b/demux/ebml.c index 1d0473a6e1..1a83726889 100644 --- a/demux/ebml.c +++ b/demux/ebml.c @@ -413,8 +413,7 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target, continue; past_end_error: - MP_DBG(ctx, "Subelement headers go " - "past end of containing element\n"); + MP_DBG(ctx, "Subelement headers go past end of containing element\n"); other_error: ctx->has_errors = true; end = startp; @@ -536,8 +535,7 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target, subelptr = (fieldtype *) fieldptr GETPTR(uintptr, uint64_t); if (length < 1 || length > 8) { - MP_DBG(ctx, "uint invalid length %"PRIu64 - "\n", length); + MP_DBG(ctx, "uint invalid length %"PRIu64"\n", length); goto error; } *uintptr = ebml_parse_uint(data, length); @@ -548,8 +546,7 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target, int64_t *sintptr; GETPTR(sintptr, int64_t); if (length < 1 || length > 8) { - MP_DBG(ctx, "sint invalid length %"PRIu64 - "\n", length); + MP_DBG(ctx, "sint invalid length %"PRIu64"\n", length); goto error; } *sintptr = ebml_parse_sint(data, length); @@ -560,8 +557,7 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target, double *floatptr; GETPTR(floatptr, double); if (length != 4 && length != 8) { - MP_DBG(ctx, "float invalid length %"PRIu64 - "\n", length); + MP_DBG(ctx, "float invalid length %"PRIu64"\n", length); goto error; } *floatptr = ebml_parse_float(data, length); @@ -579,11 +575,9 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target, strptr->start = data; strptr->len = length; if (ed->type == EBML_TYPE_STR) - MP_DBG(ctx, "string \"%.*s\"\n", - BSTR_P(*strptr)); + MP_DBG(ctx, "string \"%.*s\"\n", BSTR_P(*strptr)); else - MP_DBG(ctx, "binary %zd bytes\n", - strptr->len); + MP_DBG(ctx, "binary %zd bytes\n", strptr->len); break; case EBML_TYPE_EBML_ID:;