From dd0d3ac264754a77f34c68aadb65d593f35b0cf8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 14 Feb 2023 12:21:09 +0100 Subject: [PATCH] pw-cat: remove useless code The data stride for encoded formats should be 1 and also placed in the stride in the buffer (not 0). So there is really no difference with the regular codepath. --- src/tools/pw-cat.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/tools/pw-cat.c b/src/tools/pw-cat.c index 26cddf2d6..87e013449 100644 --- a/src/tools/pw-cat.c +++ b/src/tools/pw-cat.c @@ -785,31 +785,6 @@ static void on_process(void *userdata) n_frames = d->maxsize / data->stride; n_frames = SPA_MIN(n_frames, (int)b->requested); -#ifdef HAVE_PW_CAT_FFMPEG_INTEGRATION - n_fill_frames = data->fill(data, p, n_frames); - - if (n_fill_frames > 0 || n_frames == 0) { - d->chunk->offset = 0; - if (data->data_type == TYPE_ENCODED) { - d->chunk->stride = 0; - // encoded_playback_fill returns number of bytes - // read and not number of frames like other - // functions for raw audio. - d->chunk->size = n_fill_frames; - b->size = n_fill_frames; - } else { - d->chunk->stride = data->stride; - d->chunk->size = n_fill_frames * data->stride; - b->size = n_frames; - } - have_data = true; - } else if (n_fill_frames < 0) { - fprintf(stderr, "fill error %d\n", n_fill_frames); - } else { - if (data->verbose) - printf("drain start\n"); - } -#else n_fill_frames = data->fill(data, p, n_frames); if (n_fill_frames > 0 || n_frames == 0) { @@ -824,7 +799,6 @@ static void on_process(void *userdata) if (data->verbose) printf("drain start\n"); } -#endif } else { offset = SPA_MIN(d->chunk->offset, d->maxsize); size = SPA_MIN(d->chunk->size, d->maxsize - offset);