void stream_dump(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; char *filename = opts->stream_dump; stream_t *stream = mpctx->stream; assert(stream && filename); int64_t size = 0; stream_control(stream, STREAM_CTRL_GET_SIZE, &size); stream_set_capture_file(stream, filename); while (mpctx->stop_play == KEEP_PLAYING && !stream->eof) { if (!opts->quiet && ((stream->pos / (1024 * 1024)) % 2) == 1) { uint64_t pos = stream->pos; MP_MSG(mpctx, MSGL_STATUS, "Dumping %lld/%lld...", (long long int)pos, (long long int)size); } stream_fill_buffer(stream); for (;;) { mp_cmd_t *cmd = mp_input_get_cmd(mpctx->input, 0, false); if (!cmd) break; run_command(mpctx, cmd); talloc_free(cmd); } } }
void stream_dump(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; char *filename = opts->stream_dump; stream_t *stream = mpctx->stream; assert(stream && filename); int64_t size = 0; stream_control(stream, STREAM_CTRL_GET_SIZE, &size); stream_set_capture_file(stream, filename); while (mpctx->stop_play == KEEP_PLAYING && !stream->eof) { if (!opts->quiet && ((stream->pos / (1024 * 1024)) % 2) == 1) { uint64_t pos = stream->pos; MP_MSG(mpctx, MSGL_STATUS, "Dumping %lld/%lld...", (long long int)pos, (long long int)size); } stream_fill_buffer(stream); mp_process_input(mpctx); } }